PolyBoRi
LessEcartThenLessWeightedLengthInStrat.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_LessEcartThenLessWeightedLengthInStrat_h_
00017 #define polybori_groebner_LessEcartThenLessWeightedLengthInStrat_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 BEGIN_NAMESPACE_PBORIGB
00023 
00028 class LessEcartThenLessWeightedLengthInStrat{
00029 public:
00030   const GroebnerStrategy* strat;
00031   LessEcartThenLessWeightedLengthInStrat(const GroebnerStrategy& strat){
00032     this->strat=&strat;
00033   }
00034 
00035   bool operator() (const Monomial& a , const Monomial& b){
00036      return compare(strat->generators[a], strat->generators[b]);
00037   }
00038   
00039   bool operator() (const Exponent& a , const Exponent& b){
00040     return compare(strat->generators[a], strat->generators[b]);
00041   }
00042 
00043 private:
00044 
00045   bool compare(const PolyEntry& val1, const PolyEntry& val2) const {
00046     if (val1.ecart() != val2.ecart())
00047       return (val1.ecart() < val2.ecart());
00048 
00049     return (val1.weightedLength < val2.weightedLength);
00050   }
00051 
00052 };
00053 
00054 END_NAMESPACE_PBORIGB
00055 
00056 #endif /* polybori_LessEcartThenLessWeightedLengthInStrat_h_ */