PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
polybori
include
BooleVariable.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
89
//*****************************************************************************
90
91
#ifndef BooleVariable_h_
92
#define BooleVariable_h_
93
94
// include basic definitions
95
#include "
pbori_defs.h
"
96
97
// get BoolePolynomial's definition
98
#include "
BooleEnv.h
"
99
#include "
BoolePolynomial.h
"
100
101
BEGIN_NAMESPACE_PBORI
102
111
class
BooleVariable
{
112
113
public
:
114
//-------------------------------------------------------------------------
115
// types definitions
116
//-------------------------------------------------------------------------
117
119
120
typedef
CTypes::dd_type
dd_type
;
121
typedef
CTypes::size_type
size_type
;
122
typedef
CTypes::idx_type
idx_type
;
124
126
typedef
BooleVariable
self
;
127
129
typedef
BooleSet
set_type
;
130
132
typedef
BooleRing
ring_type
;
133
135
explicit
BooleVariable
(
idx_type
idx = 0):
136
m_poly(
BooleEnv
::persistentVariable(idx) ) {}
137
139
BooleVariable
(
idx_type
idx,
const
ring_type
& ring):
140
m_poly( ring.persistentVariable(idx) ) {}
141
142
144
BooleVariable
(
const
self
& rhs):
145
m_poly(rhs.m_poly) {}
146
148
operator
const
BoolePolynomial
&()
const
{
return
m_poly; }
149
151
idx_type
index
()
const
{
return
*m_poly.firstBegin(); }
152
154
bool
operator==
(
const
self
& other)
const
{
155
return
m_poly==other.m_poly;
156
}
157
bool
operator!=
(
const
self
& other)
const
{
158
return
m_poly!=other.m_poly;
159
}
160
set_type
set
()
const
{
return
m_poly.set(); }
161
163
ring_type
ring
()
const
{
return
m_poly.ring(); }
164
165
private
:
166
BoolePolynomial
m_poly;
167
};
168
169
170
171
inline
BoolePolynomial
172
operator/
(
const
BooleVariable
& lhs,
const
BooleVariable
& rhs) {
173
return
BoolePolynomial
(
BooleConstant
(lhs == rhs), lhs.
ring
());
174
}
175
176
177
178
END_NAMESPACE_PBORI
179
180
#endif // of BooleVariable_h_
Generated on Wed Apr 16 2014 05:41:14 for PolyBoRi by
1.8.1.2