21 #include <boost/foreach.hpp>
29 template<
class FACTOR,
class DERIVEDFACTOR>
31 std::cout << s <<
" P(";
32 BOOST_FOREACH(
Key key, frontals())
33 std::cout <<
" " << formatter(key);
36 BOOST_FOREACH(
Key parent, parents())
37 std::cout <<
" " << formatter(parent);
38 std::cout <<
")" << std::endl;
42 template<
class FACTOR,
class DERIVEDFACTOR>
TODO: Update comments.
Definition: Conditional.h:40
void print(const std::string &s="Conditional", const KeyFormatter &formatter=DefaultKeyFormatter) const
print with optional formatter
Definition: Conditional-inst.h:30
Base class for conditional densities.
bool equals(const This &c, double tol=1e-9) const
check equality
Definition: Conditional-inst.h:43
size_t Key
Integer nonlinear key type.
Definition: types.h:59
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: types.h:62
size_t nrFrontals_
The first nrFrontal variables are frontal and the rest are parents.
Definition: Conditional.h:44