16 #ifndef polybori_BooleSet_h_
17 #define polybori_BooleSet_h_
35 template<
class OrderType,
class NavigatorType,
class MonomType>
40 template<
class OrderType,
class NavigatorType,
class MonomType>
44 #define PBORI_CONST_DDFUNCS(func) \
45 self func(const self& rhs) const { return self(base::func(rhs.diagram())); }
47 #define PBORI_DDFUNCS(func) \
48 self& func(const self& rhs) { base::func(rhs.diagram()); return *this; }
50 #define PBORI_CONST_DDFUNCS_IDX(func) \
51 self func(idx_type idx) const { return self(base::func(idx)); }
53 #define PBORI_DDFUNCS_IDX(func) \
54 self& func(idx_type idx) { base::func(idx); return *this; }
99 base(idx, first, second) { }
103 const ring_type& ring):
104 base(ring, idx, first, second) { }
112 base(ring, navi.getNode()) { }
116 base(ring.zero()) { };
120 base(idx, rhs, rhs) { }
130 const_iterator begin()
const;
133 const_iterator end()
const;
136 const_reverse_iterator rbegin()
const;
139 const_reverse_iterator rend()
const;
142 reverse_exp_iterator rExpBegin()
const;
145 reverse_exp_iterator rExpEnd()
const;
148 exp_iterator expBegin()
const;
151 exp_iterator expEnd()
const;
155 return static_cast<hash_type>(
reinterpret_cast<std::ptrdiff_t
>(getNode()));
164 term_type usedVariables()
const;
167 exp_type usedVariablesExp()
const;
172 return base::change(idx);
177 self add(
const term_type& rhs)
const;
180 bool_type owns(
const term_type& rhs)
const;
183 bool_type owns(
const exp_type&)
const;
186 term_type lastLexicographicalTerm()
const;
189 self divisorsOf(
const term_type& rhs)
const;
192 self divisorsOf(
const exp_type& rhs)
const;
195 self firstDivisorsOf(
const self& rhs)
const;
198 self multiplesOf(
const term_type& rhs)
const;
201 self divide(
const term_type& rhs)
const;
205 bool_type hasTermOfVariables(
const term_type& rhs)
const;
208 self minimalElements()
const;
228 self existAbstract(
const term_type& rhs)
const;
235 return unateProduct(rhs);
254 ostream_type& print(ostream_type&)
const;
260 size_type countIndex(
idx_type idx)
const;
263 double countIndexDouble(
idx_type idx)
const ;
266 bool_type containsDivisorsOfDecDeg(
const term_type& rhs)
const;
269 bool_type containsDivisorsOfDecDeg(
const exp_type& rhs)
const;
273 inline BooleSet::ostream_type&
275 return bset.
print(os);
BoolePolyRing ring_type
Type for Boolean polynomial rings (without ordering)
Definition: BooleSet.h:76
This class is just a wrapper for using variables for storing indices as interim data structure for Bo...
Definition: BooleExponent.h:34
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
bool dd_is_pair(NaviType navi)
Definition: pbori_algo.h:805
void stable_hash_range(HashType &seed, NaviType navi)
Definition: pbori_routines_hash.h:28
BooleSet(idx_type idx, navigator first, navigator second, const ring_type &ring)
Construct new node (using navigator nodes)
Definition: BooleSet.h:102
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
BooleMonomial term_type
Type of terms.
Definition: BooleSet.h:70
const self & diagram() const
Access internal decision diagram.
Definition: BooleSet.h:231
bool_type contains(const self &rhs) const
Test containment.
Definition: BooleSet.h:239
bool_type isPair() const
Test, whether we have two terms only.
Definition: BooleSet.h:222
BooleExponent exp_type
Fix type for treatment of exponent vectors.
Definition: BooleSet.h:73
hash_type stableHash() const
Get stable hash value, which is reproducible.
Definition: BooleSet.h:159
size_type nVariables() const
Returns number of variables in manager.
Definition: BooleSet.h:248
BooleSet(const ring_type &ring, navigator navi)
Construct new node (using navigator nodes)
Definition: BooleSet.h:111
BooleSet(const base &rhs)
Copy constructor.
Definition: BooleSet.h:95
CGenericIter< LexOrder, navigator, exp_type > exp_iterator
Iterator type for iterating all exponent vectors.
Definition: BooleSet.h:82
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
std::ostream ostream_type
Type for out-stream.
Definition: pbori_defs.h:246
BooleSet::ostream_type & operator<<(BooleSet::ostream_type &os, const BooleSet &bset)
Stream output operator.
Definition: BooleSet.h:274
double sizeDouble() const
Approximation of number of terms.
Definition: BooleSet.h:251
std::size_t hash_type
Type for hashing.
Definition: pbori_defs.h:231
bool dd_is_singleton(NaviType navi)
Definition: pbori_algo.h:770
This template class defines a facade for decision diagrams.
Definition: CCuddDDFacade.h:103
This class is used for polybori's exception handling.
Definition: PBoRiError.h:31
size_type size() const
Returns number of terms.
Definition: BooleSet.h:242
CCuddDDFacade< BoolePolyRing, BooleSet > base
Generic access to base type.
Definition: BooleSet.h:67
BooleSet(navigator navi, const ring_type &ring)
Construct from navigator node.
Definition: BooleSet.h:123
bool_type isSingleton() const
Test, whether we have one term only.
Definition: BooleSet.h:214
BooleSet(const ring_type &ring, node_ptr node)
Construct new node (using nodes)
Definition: BooleSet.h:107
self emptyElement() const
Get corresponding zero element (may be removed in the future)
Definition: BooleSet.h:257
int idx_type
Type for indices.
Definition: pbori_defs.h:228
bool_type ownsOne() const
Test whether the empty set is included.
Definition: BooleSet.h:211
Definition: BooleSet.h:41
Definition: BoolePolynomial.h:70
self change(idx_type idx) const
Definition: BooleSet.h:169
BooleSet(const self &rhs)
Copy constructor.
Definition: BooleSet.h:92
bool_type isSingletonOrPair() const
Test, whether we have one or two terms only.
Definition: BooleSet.h:217
ostream_type & print(ostream_type &) const
Print current set to output stream.
Definition: BooleSet.cc:266
self cartesianProduct(const self &rhs) const
Cartesean product.
Definition: BooleSet.h:234
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
This class defines an iterator for navigating through then and else branches of ZDDs.
Definition: CCuddNavigator.h:36
size_type length() const
Returns number of terms (deprecated)
Definition: BooleSet.h:245
BooleSet(const ring_type &ring)
Construct empty set in ring.
Definition: BooleSet.h:115
BooleSet(idx_type idx, const self &rhs)
Construct new node (using navigator for then and else-branches)
Definition: BooleSet.h:119
Definition: BooleSet.h:57
bool dd_is_singleton_or_pair(NaviType navi)
Definition: pbori_algo.h:798
CReverseIter< LexOrder, navigator, term_type > const_reverse_iterator
Iterator type for iterating all monomials.
Definition: BooleSet.h:88
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
self dd_type
Generic access to type of *this.
Definition: BooleSet.h:64
~BooleSet()
Destructor.
Definition: BooleSet.h:127
bool bool_type
Type for standard true/false statements.
Definition: pbori_defs.h:216
#define PBORI_UNLIKELY(expression)
Definition: pbori_defs.h:59
BooleSet(idx_type idx, const self &first, const self &second)
Construct new node.
Definition: BooleSet.h:98
CGenericIter< LexOrder, navigator, term_type > const_iterator
Iterator type for iterating all monomials.
Definition: BooleSet.h:79
CReverseIter< LexOrder, navigator, exp_type > reverse_exp_iterator
Iterator type for iterating all exponent vectors.
Definition: BooleSet.h:85
hash_type hash() const
Get unique hash value (valid only per runtime)
Definition: BooleSet.h:154
DdNode * node_ptr
Definition: CApplyNodeFacade.h:50
bool owns_one(NaviType navi)
Test whether the empty set is included.
Definition: pbori_algo.h:318