51#ifndef DOXYGEN_SHOULD_SKIP_THIS
58 template <
class Generator >
61 if (_output_row_ !=
nullptr)
63 "you cannot insert a new generator while a generation is "
64 "still being processed");
66 _generators_.push_back(
generator.clone());
69 _setInputRow_performed_.push_back(0);
71 delete _generators_.back();
72 _generators_.pop_back();
77 _output_row_ =
nullptr;
81 template <
class Generator >
84 if (_output_row_ !=
nullptr)
86 "you cannot insert a new generator while a generation is "
87 "still being processed");
89 _generators_.insert(_generators_.begin() + i,
generator.clone());
92 _setInputRow_performed_.push_back(0);
94 delete *(_generators_.begin() + i);
95 _generators_.erase(_generators_.begin() + i);
100 _output_row_ =
nullptr;
104 template < GUM_Numeric GUM_SCALAR >
106 HashTable< DBRowGeneratorWithBN< GUM_SCALAR >*,
const BayesNet< GUM_SCALAR >* > old_bns;
108 for (
auto xgen: _generators_) {
110 DBRowGeneratorWithBN< GUM_SCALAR >* gen =
nullptr;
112 gen =
dynamic_cast< DBRowGeneratorWithBN< GUM_SCALAR >*
>(xgen);
113 }
catch (std::bad_cast&) {}
115 if (gen !=
nullptr) {
118 const BayesNet< GUM_SCALAR >* bn = &(gen->getBayesNet());
119 old_bns.insert(gen, bn);
120 gen->setBayesNet(new_bn);
125 for (
auto& generator: old_bns) {
class for packing sets of generators
void insertGenerator(const Generator &generator)
inserts a new generator at the end of the set
void setBayesNet(const BayesNet< GUM_SCALAR > &new_bn)
assign a new Bayes net to all the generators that depend on a BN
#define GUM_ERROR(type, msg)
std::mt19937 & generator()
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities