RankingVector.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_RankingVector_h_
#define polybori_groebner_RankingVector_h_
// include basic definitions
#include "groebner_defs.h"
#include <vector>
BEGIN_NAMESPACE_PBORIGB
class RankingVector:
public std::vector<int> {
typedef std::vector<value_type> base;
public:
RankingVector(size_type len): base(len, 0) {}
void increment(size_type idx) { ++operator[](idx); }
void rerank(const Exponent& exp) {
if (exp.deg() >= 2)
for_each(exp.begin(), exp.end(), *this, &RankingVector::increment);
}
value_type max_index() const {
return (empty()? -1: std::max_element(begin(), end()) - begin());
}
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_RankingVector_h_ */
polybori::BooleExponent
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
polybori::BooleExponent::begin
const_iterator begin() const
Start iteration over indices (constant access)
Definition: BooleExponent.h:97
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::RankingVector::max_index
value_type max_index() const
Definition: RankingVector.h:44
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
groebner_defs.h
polybori::groebner::RankingVector::increment
void increment(size_type idx)
Definition: RankingVector.h:37
polybori::BooleExponent::end
const_iterator end() const
Finish iteration over indices (constant access)
Definition: BooleExponent.h:100
polybori::groebner::RankingVector
This class defines RankingVector.
Definition: RankingVector.h:30
polybori::groebner::RankingVector::rerank
void rerank(const Exponent &exp)
Definition: RankingVector.h:39
polybori::BooleExponent::deg
deg_type deg() const
Degree of the corresponding monomial.
Definition: BooleExponent.h:118
polybori::groebner::RankingVector::RankingVector
RankingVector(size_type len)
Definition: RankingVector.h:35
polybori::for_each
void for_each(InIter start, InIter finish, Object &obj, MemberFuncPtr func)
Definition: pbori_algo.h:857