PolyBoRi
IsVariableOfIndex.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_groebner_IsVariableOfIndex_h_
17 #define polybori_groebner_IsVariableOfIndex_h_
18 
19 // include basic definitions
20 #include "groebner_defs.h"
21 
22 #include "PolyEntry.h"
23 
25 
32 public:
33  IsVariableOfIndex(idx_type value): m_value(value) {}
34 
35  bool operator()(const PolyEntry& rhs) const {
36  return (rhs.isSingleton() && rhs.usedVariables.deg() == 1) &&
37  (*(rhs.usedVariables.begin()) == m_value);
38  }
39 
40 private:
41  idx_type m_value;
42 };
43 
45 
46 #endif /* polybori_groebner_IsVariableOfIndex_h_ */
Exponent usedVariables
Definition: PolyEntryBase.h:62
const_iterator begin() const
Start iteration over indices (constant access)
Definition: BooleExponent.h:97
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
IsVariableOfIndex(idx_type value)
Definition: IsVariableOfIndex.h:33
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
This class defines PolyEntry.
Definition: PolyEntry.h:32
Definition: IsVariableOfIndex.h:31
bool isSingleton() const
Definition: PolyEntry.h:67
bool operator()(const PolyEntry &rhs) const
Definition: IsVariableOfIndex.h:35
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
deg_type deg() const
Degree of the corresponding monomial.
Definition: BooleExponent.h:118