16 #ifndef polybori_iterators_CExpIter_h_
17 #define polybori_iterators_CExpIter_h_
29 template <
class ExpType>
41 template <
class SequenceType>
47 void resize(size_type nlen) { m_result.resize(nlen); }
50 void reserve(size_type nlen) { m_result.reserve(nlen); }
53 size_type
size()
const {
return m_result.size(); }
56 template <
class Iterator>
57 void append(Iterator start, Iterator finish) {
58 while (start != finish){
59 m_result.push_back(*start);
69 template <
class NaviType,
class ExpType>
76 template <
class NaviType,
class ExpType>
78 public pbori_base<CExpIter<NaviType, ExpType> >::type {
88 CExpIter(NaviType navi): base(navi, typename base::term_generator() ) {
89 base::m_getTerm.reserve(base::m_stack.size());
90 base::m_getTerm.append(base::begin(), base::end());
97 if (base::m_stack.markedOne()) {
98 base::m_stack.clearOne();
101 base::m_stack.next();
102 base::m_getTerm.resize( base::m_stack.size() == 0 ?
104 base::m_stack.size() - 1);
106 if (!base::m_stack.empty()) {
107 base::m_stack.followThen();
108 base::m_stack.terminate();
111 base::m_getTerm.reserve(base::m_stack.size());
112 base::m_getTerm.append(base::begin() + base::m_getTerm.size(), base::end());
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
pbori_base< self >::type base
Get base type.
Definition: CExpIter.h:85
Definition: pbori_func.h:881
ExpType value_type
Definition: CExpIter.h:33
void reserve(size_type nlen)
Prepare space for nlen elements.
Definition: CExpIter.h:50
CTermIter< stack_type, CExpGenerator< ExpType > > type
Definition: CExpIter.h:73
This class defines an iterator for the monomials in a Boolean polynomial.
Definition: CTermIter.h:44
CTermStack< NaviType, std::forward_iterator_tag > stack_type
Definition: CExpIter.h:72
This class defines an iterator for the monomials in a Boolean polynomial.
Definition: CTermStack.h:353
CExpIter(NaviType navi)
Construct iteraor from navigator over decision diagram structure.
Definition: CExpIter.h:88
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
Definition: CExpIter.h:30
result_type operator()(const SequenceType &) const
Return currently stored results.
Definition: CExpIter.h:42
self & operator++()
Prefix incrementation operation.
Definition: CExpIter.h:116
const value_type & result_type
Definition: CExpIter.h:34
self operator++(int)
Postfix incrementation operation.
Definition: CExpIter.h:121
size_type size() const
Get current size.
Definition: CExpIter.h:53
CExpGenerator()
Default constructor.
Definition: CExpIter.h:38
void increment()
Incrementation operation core.
Definition: CExpIter.h:95
value_type::size_type size_type
Definition: CExpIter.h:35
void append(Iterator start, Iterator finish)
Append elements to exponent vector.
Definition: CExpIter.h:57
Definition: BoolePolynomial.h:73
void resize(size_type nlen)
Take the first nlen elements of the exponent vector only.
Definition: CExpIter.h:47