PolyBoRi
LessCombinedManySizesInStrat.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_LessCombinedManySizesInStrat_h_
00017 #define polybori_groebner_LessCombinedManySizesInStrat_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 BEGIN_NAMESPACE_PBORIGB
00023 
00028 class LessCombinedManySizesInStrat{
00029 public:
00030   const GroebnerStrategy* strat;
00031   LessCombinedManySizesInStrat(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     wlen_type w1 = d1;
00044     wlen_type w2 = d2;
00045     w1 *= entry1.length;
00046     w1 *= entry1.ecart();
00047     w2 *= entry2.length;
00048     w2 *= entry2.ecart();
00049     return w1 < w2;       
00050   }
00051 };
00052 
00053 END_NAMESPACE_PBORIGB
00054 
00055 #endif /* polybori_LessCombinedManySizesInStrat_h_ */