49#ifndef DOXYGEN_SHOULD_SKIP_THIS
56 template <
class Generator >
59 if (_output_row_ !=
nullptr)
61 "you cannot insert a new generator while a generation is "
62 "still being processed");
64 _generators_.push_back(
generator.clone());
67 _setInputRow_performed_.push_back(0);
69 delete _generators_.back();
70 _generators_.pop_back();
75 _output_row_ =
nullptr;
79 template <
class Generator >
82 if (_output_row_ !=
nullptr)
84 "you cannot insert a new generator while a generation is "
85 "still being processed");
87 _generators_.insert(_generators_.begin() + i,
generator.clone());
90 _setInputRow_performed_.push_back(0);
92 delete *(_generators_.begin() + i);
93 _generators_.erase(_generators_.begin() + i);
98 _output_row_ =
nullptr;
102 template <
typename GUM_SCALAR >
104 HashTable< DBRowGeneratorWithBN< GUM_SCALAR >*,
const BayesNet< GUM_SCALAR >* > old_bns;
106 for (
auto xgen: _generators_) {
108 DBRowGeneratorWithBN< GUM_SCALAR >* gen =
nullptr;
110 gen =
dynamic_cast< DBRowGeneratorWithBN< GUM_SCALAR >*
>(xgen);
111 }
catch (std::bad_cast&) {}
113 if (gen !=
nullptr) {
116 const BayesNet< GUM_SCALAR >* bn = &(gen->getBayesNet());
117 old_bns.insert(gen, bn);
118 gen->setBayesNet(new_bn);
123 for (
auto& generator: old_bns) {
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