17 #ifndef polybori_BoolePolyRing_h_
18 #define polybori_BoolePolyRing_h_
27 #include <boost/intrusive_ptr.hpp>
79 typedef boost::intrusive_ptr<core_type>
core_ptr;
108 p_core(rhs.operator->()) {
PBORI_ASSERT(p_core != NULL); }
112 explicit BoolePolyRing(size_type nvars = 1,
113 ordercode_type order =
lp);
117 p_core(new core_type(nvars, order)) {}
130 return p_core->m_names[idx];
135 p_core->m_names.set(idx, varname);
142 ostream_type& print(ostream_type&)
const;
146 return static_cast<hash_type>(
reinterpret_cast<std::ptrdiff_t
152 return static_cast<hash_type>(
reinterpret_cast<std::ptrdiff_t
>(p_core.operator->()));
156 order_reference
ordering()
const {
return *(p_core->pOrder); }
159 mgr_type*
getManager()
const {
return p_core->m_mgr.getManager(); }
162 self clone()
const {
return self(core_ptr(
new core_type(*p_core))); }
165 void changeOrdering(ordercode_type);
168 poly_type coerce(
const poly_type& rhs)
const;
171 monom_type coerce(
const monom_type& rhs)
const;
174 var_type coerce(
const var_type& rhs)
const;
177 dd_type variableDiagram(checked_idx_type nvar)
const;
180 var_type variable(checked_idx_type nvar)
const;
183 dd_type zero()
const;
189 dd_type constant(
bool is_one)
const;
193 core_ptr core()
const {
return p_core; };
200 inline BoolePolyRing::ostream_type&
202 return ring.
print(os);
208 #endif // of #ifndef polybori_BoolePolyRing_h_
mgr_type * getManager() const
Get plain decision diagram manager.
Definition: BoolePolyRing.h:159
order_type & order_reference
Reference for handling mterm orderings.
Definition: BoolePolyRing.h:88
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
variable_names_type::const_reference const_varname_reference
Define type for getting names of variables.
Definition: CCuddCore.h:63
ordercodes
Codes For orderings.
Definition: pbori_defs.h:154
CTypes::vartext_type vartext_type
Definition: BoolePolyRing.h:69
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
core_type::const_varname_reference const_varname_reference
Definition: BoolePolyRing.h:77
CCheckedIdx checked_idx_type
Check indices bevor using.
Definition: BoolePolyRing.h:73
BoolePolyRing::ostream_type & operator<<(BoolePolyRing::ostream_type &os, const BoolePolyRing &ring)
Stream output operator.
Definition: BoolePolyRing.h:201
This struct contains type definitions and enumerations to be used for order codes.
Definition: pbori_defs.h:152
self clone() const
Construct ring with similiar properties (deep copy)
Definition: BoolePolyRing.h:162
class BooleVariable var_type
set variables type
Definition: BoolePolyRing.h:59
class BooleMonomial monom_type
set monomial type
Definition: BoolePolyRing.h:56
Definition: COrderingBase.h:43
This class reinterprets decicion diagram managers as Boolean polynomial rings, adds an ordering and v...
Definition: BoolePolyRing.h:40
CCuddCore core_type
Type of actual data.
Definition: BoolePolyRing.h:76
std::vector< idx_type > block_idx_type
Type for block indices.
Definition: BoolePolyRing.h:95
CTypes::ordercode_type ordercode_type
Definition: BoolePolyRing.h:68
order_reference ordering() const
Access ordering of *this.
Definition: BoolePolyRing.h:156
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
This class defines WeakRingPtr.
Definition: WeakRingPtr.h:32
This class wraps the underlying decicion diagram type and defines the necessary operations.
Definition: BoolePolynomial.h:85
hash_type id() const
Get unique identifier for this ring.
Definition: BoolePolyRing.h:151
This class prepares the CUDD's raw decision diagram manager structure for the use with instrinsive po...
Definition: CCuddCore.h:50
std::size_t hash_type
Type for hashing.
Definition: pbori_defs.h:231
class BooleSet dd_type
set decision diagram type
Definition: BoolePolyRing.h:62
class BooleExponent exp_type
define exponent type
Definition: BoolePolyRing.h:53
void clearCache()
Clears the function cache.
Definition: BoolePolyRing.h:139
pbori_DdManager DdManager
Definition: traits.h:33
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
vartext_type getVariableName(checked_idx_type idx) const
Get name of variable with index idx.
Definition: BoolePolyRing.h:129
size_type nVariables() const
Get number of ring variables.
Definition: BoolePolyRing.h:126
ostream_type & print(ostream_type &) const
Print out statistics and settings for current ring to output stream.
Definition: BoolePolyRing.cc:120
core_type::order_ptr order_ptr
Smart pointer for handling mterm orderings.
Definition: BoolePolyRing.h:85
void setVariableName(checked_idx_type idx, vartext_type varname)
Set name of variable with index idx.
Definition: BoolePolyRing.h:134
~BoolePolyRing()
Destructor.
Definition: BoolePolyRing.h:123
BoolePolyRing(const CWeakPtr< core_type > &rhs)
Get strong reference from weak pointer (used by WeakRingPtr)
Definition: BoolePolyRing.h:107
Forward declaration of friend.
Definition: CWeakPtr.h:31
const char * vartext_type
Type for setting/getting names of variables.
Definition: pbori_defs.h:249
BoolePolyRing(const self &rhs)
Copy constructor (cheap)
Definition: BoolePolyRing.h:120
hash_type hash() const
Get unique identifier for manager of *this.
Definition: BoolePolyRing.h:145
BoolePolyRing(const core_ptr &rhs)
Definition: BoolePolyRing.h:104
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
boost::shared_ptr< order_type > order_ptr
Smart pointer for handling mterm orderings.
Definition: CCuddCore.h:72
Definition: BooleSet.h:57
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleMonomial.h:50
block_idx_type::const_iterator block_iterator
Type for block iterators.
Definition: BoolePolyRing.h:98
DdManager mgr_type
Definition: BoolePolyRing.h:90
This class is just a wrapper for using variables from cudd's decicion diagram.
Definition: BooleVariable.h:39
This struct contains type definitions and enumerations to be used for comparisons.
Definition: pbori_defs.h:193
boost::intrusive_ptr< core_type > core_ptr
Smart pointer to core.
Definition: BoolePolyRing.h:79
This class defines CCheckedIdx.
Definition: CCheckedIdx.h:29
int ordercode_type
Type for ordering codes.
Definition: pbori_defs.h:240
BoolePolyRing(size_type nvars, const order_ptr &order)
Constructor for nvars variables (and given pointer to ordering)
Definition: BoolePolyRing.h:116
core_type::order_type order_type
Type for handling mterm orderings.
Definition: BoolePolyRing.h:82
class BoolePolynomial poly_type
set polynomial type
Definition: BoolePolyRing.h:65