PolyBoRi
PairLS.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_PairLS_h_
00017 #define polybori_groebner_PairLS_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 #include <boost/shared_ptr.hpp>
00022 
00023 BEGIN_NAMESPACE_PBORIGB
00024 
00025 typedef boost::shared_ptr<PairData> pair_data_ptr;
00026 
00027 enum {
00028   VARIABLE_PAIR,
00029   IJ_PAIR,
00030   DELAYED_PAIR
00031 };
00032 
00033 
00034 
00039 class PairLS{
00040 private:
00041   int type;
00042 public:
00043   int getType() const{
00044     return type;
00045   }
00046   wlen_type wlen;
00047   deg_type sugar;
00048   //three sorts of pairs
00049   //x*poly, poly, i,j
00050   pair_data_ptr data;
00051   Monomial lm; //must not be the real lm, can be lm of syzygy or something else
00052   Polynomial extract(const PolyEntryVector& v){
00053     return data->extract(v);
00054   }
00055   PairLS(int i, int j, const PolyEntryVector &v):
00056     wlen(v[i].weightedLength+v[j].weightedLength-2),
00057     data(new IJPairData(i,j)),
00058     lm(v[i].lead*v[j].lead)
00059   {
00060     type=IJ_PAIR;
00061     sugar=lm.deg()+std::max(v[i].ecart(),v[j].ecart());
00062   }
00063   PairLS(int i, idx_type v, const PolyEntryVector &gen,int type):
00064      // sugar(gen[i].lmDeg+1),///@only do that because of bad criteria impl
00065     wlen(gen[i].weightedLength+gen[i].length),
00066     sugar(gen[i].deg+1),
00067     data(new VariablePairData(i,v)), lm(gen[i].lead) {
00068     PBORI_ASSERT(type==VARIABLE_PAIR);
00069     this->type=type;
00070   }
00071   
00072   PairLS(const Polynomial& delayed):
00073     type(DELAYED_PAIR), wlen(delayed.eliminationLength()), 
00074     sugar(delayed.deg()),
00075     data(new PolyPairData(delayed)), 
00076     lm(delayed.lead()) { }
00077   
00078 };
00079 
00080 END_NAMESPACE_PBORIGB
00081 
00082 #endif /* polybori_PairLS_h_ */