PolyBoRi
IsVariableOfIndex.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_groebner_IsVariableOfIndex_h_
00017 #define polybori_groebner_IsVariableOfIndex_h_
00018 
00019 // include basic definitions
00020 #include "groebner_defs.h"
00021 
00022 #include "PolyEntry.h"
00023 
00024 BEGIN_NAMESPACE_PBORIGB
00025 
00031 class IsVariableOfIndex {
00032 public:
00033   IsVariableOfIndex(idx_type value): m_value(value) {}
00034 
00035   bool operator()(const PolyEntry& rhs) const {
00036     return (rhs.isSingleton() && rhs.usedVariables.deg() == 1) && 
00037       (*(rhs.usedVariables.begin()) == m_value);
00038   }
00039 
00040 private:
00041   idx_type m_value;
00042 };
00043 
00044 END_NAMESPACE_PBORIGB
00045 
00046 #endif /* polybori_groebner_IsVariableOfIndex_h_ */