PolyBoRi
PolyEntry.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_PolyEntry_h_
00017 #define polybori_groebner_PolyEntry_h_
00018 
00019 #include "LiteralFactorization.h"
00020 #include "PolyEntryBase.h"
00021 
00022 // include basic definitions
00023 #include "groebner_defs.h"
00024 
00025 BEGIN_NAMESPACE_PBORIGB
00026 
00027 
00032 class PolyEntry:
00033   public PolyEntryBase {
00034   PolyEntry();                 /* never use this one! */
00035 
00036   typedef PolyEntry self;
00037   typedef PolyEntryBase base;
00038 
00039 public:
00040   PolyEntry(const Polynomial &p): base(p) {}
00041 
00042   bool operator==(const self& other) const { return p == other.p; }
00043 
00044   self& operator=(const self& rhs) {
00045     return static_cast<self&>(base::operator=(rhs));
00046   }
00047 
00048   self& operator=(const Polynomial& rhs) {
00049     p = rhs;
00050     recomputeInformation();
00051     return *this;
00052   }
00053 
00054   deg_type ecart() const{ return deg-leadDeg; }
00055 
00056   void recomputeInformation();
00057 
00058   void markVariablePairsCalculated() {
00059     vPairCalculated.insert(leadExp.begin(), leadExp.end());
00060   }
00061 
00062   bool propagatableBy(const PolyEntry& other) const {
00063     return minimal && (deg <= 2) && (length > 1) && (p != other.p) &&
00064       tailVariables.reducibleBy(other.leadExp);
00065   }
00066 
00067   bool isSingleton() const { return length == 1; }
00068 };
00069 
00070 
00071 
00072 
00073 
00074 inline bool
00075 should_propagate(const PolyEntry& e){
00076   return ( (e.length == 1) && (e.deg > 0) && (e.deg < 4) ) ||
00077     ( (e.length == 2) && (e.ecart() == 0) && (e.deg < 3) );
00078 
00079 }
00080 
00081 END_NAMESPACE_PBORIGB
00082 
00083 #endif /* polybori_PolyEntry_h_ */