PolyBoRi
LessEcartThenLessWeightedLengthInStrat.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_groebner_LessEcartThenLessWeightedLengthInStrat_h_
17 #define polybori_groebner_LessEcartThenLessWeightedLengthInStrat_h_
18 
19 // include basic definitions
20 #include "groebner_defs.h"
21 
23 
29 public:
32  this->strat=&strat;
33  }
34 
35  bool operator() (const Monomial& a , const Monomial& b){
36  return compare(strat->generators[a], strat->generators[b]);
37  }
38 
39  bool operator() (const Exponent& a , const Exponent& b){
40  return compare(strat->generators[a], strat->generators[b]);
41  }
42 
43 private:
44 
45  bool compare(const PolyEntry& val1, const PolyEntry& val2) const {
46  if (val1.ecart() != val2.ecart())
47  return (val1.ecart() < val2.ecart());
48 
49  return (val1.weightedLength < val2.weightedLength);
50  }
51 
52 };
53 
55 
56 #endif /* polybori_LessEcartThenLessWeightedLengthInStrat_h_ */