26 template class FactorGraph<DiscreteConditional>;
38 result += conditional->logProbability(values);
47 result *= (*conditional)(
values);
60 (*it)->sampleInPlace(&result);
71 ss <<
"`DiscreteBayesNet` of size " <<
size() << endl << endl;
73 ss << conditional->markdown(keyFormatter, names) << endl;
82 ss <<
"<div><p><tt>DiscreteBayesNet</tt> of size " <<
size() <<
"</p>";
84 ss << conditional->html(keyFormatter, names) << endl;
bool equals(const This &fg, double tol=1e-9) const
Check equality up to tolerance.
double evaluate(const DiscreteValues &values) const
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const
Render as markdown tables.
std::reverse_iterator< Iterator > make_reverse_iterator(Iterator i)
const_iterator begin() const
double logProbability(const DiscreteValues &values) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
const_iterator end() const
static std::stringstream ss
DiscreteValues::Names Names
Translation table from values to strings.
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const
Render as html tables.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
DiscreteValues sample() const
do ancestral sampling
bool equals(const This &bn, double tol=1e-9) const