00001 // -*- c++ -*- 00002 //***************************************************************************** 00014 //***************************************************************************** 00015 00016 #ifndef polybori_groebner_LessUsedTailVariablesThenLessWeightedLengthInStrat_h_ 00017 #define polybori_groebner_LessUsedTailVariablesThenLessWeightedLengthInStrat_h_ 00018 00019 // include basic definitions 00020 #include "groebner_defs.h" 00021 00022 BEGIN_NAMESPACE_PBORIGB 00023 00028 class LessUsedTailVariablesThenLessWeightedLengthInStrat{ 00029 public: 00030 const GroebnerStrategy* strat; 00031 LessUsedTailVariablesThenLessWeightedLengthInStrat(const GroebnerStrategy& strat){ 00032 this->strat=&strat; 00033 } 00034 00035 bool operator() (const Monomial& a, const Monomial& b) const{ 00036 return operator()(strat->generators[a], strat->generators[b]); 00037 } 00038 00039 private: 00040 bool operator() (const PolyEntry& entry1, const PolyEntry& entry2) const { 00041 deg_type d1 = entry1.tailVariables.deg(); 00042 deg_type d2 = entry2.tailVariables.deg(); 00043 if (d1 != d2) 00044 return (d1 < d2); 00045 00046 return (entry1.weightedLength < entry2.weightedLength); 00047 } 00048 00049 }; 00050 00051 END_NAMESPACE_PBORIGB 00052 00053 #endif /* polybori_LessUsedTailVariablesThenLessWeightedLengthInStrat_h_ */