#include <dai/varset.h>
Public Member Functions | |
Constructors and destructors | |
VarSet () | |
Default constructor (constructs an empty set). | |
VarSet (const SmallSet< Var > &x) | |
Construct from SmallSet<Var> x. | |
VarSet (const Var &v) | |
Construct a VarSet with one element, v. | |
VarSet (const Var &v1, const Var &v2) | |
Construct a VarSet with two elements, v1 and v2. | |
template<typename VarIterator> | |
VarSet (VarIterator begin, VarIterator end, size_t sizeHint=0) | |
Construct a VarSet from the range between begin and end. | |
Queries | |
long double | nrStates () const |
Calculates the number of states of this VarSet, which is simply the number of possible joint states of the variables in *this . | |
Friends | |
Input and output | |
std::ostream & | operator<< (std::ostream &os, const VarSet &vs) |
Writes a VarSet to an output stream. |
example_permute.cpp, example_sprinkler.cpp, example_varset.cpp, and uai2010-aie-solver.cpp.
dai::VarSet::VarSet | ( | ) | [inline] |
Default constructor (constructs an empty set).
Construct a VarSet with two elements, v1 and v2.
dai::VarSet::VarSet | ( | VarIterator | begin, | |
VarIterator | end, | |||
size_t | sizeHint = 0 | |||
) | [inline] |
long double dai::VarSet::nrStates | ( | ) | const [inline] |
Calculates the number of states of this VarSet, which is simply the number of possible joint states of the variables in *this
.
The number of states of the Cartesian product of the variables in this VarSet is simply the product of the number of states of each variable in this VarSet. If *this
corresponds with the set , where variable
has label
, and denoting by
the number of possible values ("states") of variable
, the number of joint configurations of the variables in
is given by
.
std::ostream& operator<< | ( | std::ostream & | os, | |
const VarSet & | vs | |||
) | [friend] |
Writes a VarSet to an output stream.