#include #include #include #include #include #include using std::vector; using std::set; GibbsSampler::GibbsSampler(StochasticNode *node, Graph const &graph) : Sampler(vector(1, node), graph) { } void GibbsSampler::setValue(double const *value, unsigned long length) { nodes().front()->data.setValue(value, length); vector const &dc = deterministicChildren(); for (vector::const_iterator i(dc.begin()); i != dc.end(); ++i) { (*i)->forwardSample(); } } StochasticNode *GibbsSampler::node() { return nodes().front(); }