PairStatusSet.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_groebner_PairStatusSet_h_
#define polybori_groebner_PairStatusSet_h_
// include basic definitions
#include "groebner_defs.h"
#include <boost/dynamic_bitset.hpp>
BEGIN_NAMESPACE_PBORIGB
class PairStatusSet{
public:
typedef boost::dynamic_bitset<> bitvector_type;
bool hasTRep(int ia, int ja) const {
int i,j;
i=std::min(ia,ja);
j=std::max(ia,ja);
return table[j][i]==HAS_T_REP;
}
void setToHasTRep(int ia, int ja){
int i,j;
i=std::min(ia,ja);
j=std::max(ia,ja);
table[j][i]=HAS_T_REP;
}
template <class Iterator>
void setToHasTRep(Iterator start, Iterator finish, int ja){
for (; start != finish; ++start)
setToHasTRep(*start, ja);
}
void setToUncalculated(int ia, int ja){
int i,j;
i=std::min(ia,ja);
j=std::max(ia,ja);
table[j][i]=UNCALCULATED;
}
template <class Iterator>
void setToUncalculated(Iterator start, Iterator finish, int ja){
for (; start != finish; ++start)
setToUncalculated(*start, ja);
}
int prolong(bool value=UNCALCULATED){
int s=table.size();
table.push_back(bitvector_type(s, value));
return s;
}
PairStatusSet(int size=0){
int s=0;
for(s=0;s<size;s++){
prolong();
}
}
static const bool HAS_T_REP=true;
static const bool UNCALCULATED=false;
protected:
std::vector<bitvector_type> table;
};
END_NAMESPACE_PBORIGB
#endif /* polybori_PairStatusSet_h_ */
END_NAMESPACE_PBORIGB
#define END_NAMESPACE_PBORIGB
Definition: groebner_defs.h:16
polybori::groebner::PairStatusSet::setToHasTRep
void setToHasTRep(Iterator start, Iterator finish, int ja)
Definition: PairStatusSet.h:47
BEGIN_NAMESPACE_PBORIGB
#define BEGIN_NAMESPACE_PBORIGB
Definition: groebner_defs.h:15
polybori::groebner::PairStatusSet::PairStatusSet
PairStatusSet(int size=0)
Definition: PairStatusSet.h:69
polybori::groebner::PairStatusSet::table
std::vector< bitvector_type > table
Definition: PairStatusSet.h:79
groebner_defs.h
polybori::groebner::PairStatusSet::setToHasTRep
void setToHasTRep(int ia, int ja)
Definition: PairStatusSet.h:39
polybori::groebner::PairStatusSet::bitvector_type
boost::dynamic_bitset bitvector_type
Definition: PairStatusSet.h:32
polybori::groebner::PairStatusSet::setToUncalculated
void setToUncalculated(int ia, int ja)
Definition: PairStatusSet.h:51
polybori::groebner::PairStatusSet::hasTRep
bool hasTRep(int ia, int ja) const
Definition: PairStatusSet.h:33
polybori::groebner::PairStatusSet::setToUncalculated
void setToUncalculated(Iterator start, Iterator finish, int ja)
Definition: PairStatusSet.h:59
polybori::groebner::PairStatusSet
This class defines PairStatusSet.
Definition: PairStatusSet.h:30
polybori::groebner::PairStatusSet::prolong
int prolong(bool value=UNCALCULATED)
Definition: PairStatusSet.h:64