PolyBoRi
RedTailNth.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_RedTailNth_h_
00017 #define polybori_groebner_RedTailNth_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 #include "PolyEntry.h"
00023 #include "PolyEntryReference.h"
00024 #include "ReductionStrategy.h"
00025 
00026 BEGIN_NAMESPACE_PBORIGB
00027 
00035 class RedTailNth {
00036 public:
00037   RedTailNth(ReductionStrategy& strat): m_strat(strat) {}
00038 
00039   template <class KeyType>
00040   const Polynomial& operator()(const KeyType& key) {
00041     return get(m_strat(key)).p;
00042   }
00043 
00044 private:
00045   const PolyEntry& get(PolyEntryReference entry) {
00046     return entry = red_tail(m_strat, entry.get().p);
00047   }
00048 
00049   ReductionStrategy& m_strat;
00050 };
00051 
00052 END_NAMESPACE_PBORIGB
00053 
00054 #endif /* polybori_groebner_RedTailNth_h_ */