PolyBoRi
PairECompare.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_PairECompare_h_
00017 #define polybori_groebner_PairECompare_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 BEGIN_NAMESPACE_PBORIGB
00023 
00028 class PairECompare: 
00029   public CFactoryBase {
00030 public:
00031   PairECompare(const BoolePolyRing& ring):
00032     CFactoryBase(ring) {}
00033 
00035   bool operator() (const PairE& l, const PairE& r){
00036     if (l.sugar!=r.sugar) return l.sugar>r.sugar; //greater sugar, less importance
00037     if (l.wlen!=r.wlen) return l.wlen>r.wlen;
00038     if (l.lm!=r.lm) return parent().ordering().compare(l.lm, r.lm) 
00039                       == CTypes::greater_than;
00040     
00042     return false;
00043   }
00044 };
00045 
00046 END_NAMESPACE_PBORIGB
00047 
00048 #endif /* polybori_PairECompare_h_ */