33 template <
typename GUM_SCALAR >
35 ICPTGenerator< GUM_SCALAR >() {
40 template <
typename GUM_SCALAR >
49 template <
typename GUM_SCALAR >
52 std::vector< GUM_SCALAR > v;
65 GUM_SCALAR sum = (GUM_SCALAR)0;
72 cpt.
set(cptInst, cpt[cptInst] / sum);
aGrUM's Potential is a multi-dimensional array with tensor operators.
Abstract class for generating Conditional Probability Tables.
virtual Size domainSize() const final
Returns the product of the variables domain size.
Idx randomValue(const Size max=2)
Returns a random Idx between 0 and max-1 included.
gum is the global namespace for all aGrUM entities
void unsetEnd()
Alias for unsetOverflow().
void incOut(const Instantiation &i)
Operator increment for the variables not in i.
void setFirstIn(const Instantiation &i)
Assign the first values in the Instantiation for the variables in i.
SimpleCPTGenerator()
Default constructor.
const Potential< GUM_SCALAR > & fillWith(const Potential< GUM_SCALAR > &src) const
copy a Potential data using name of variables and labels (not necessarily the same variables in the s...
~SimpleCPTGenerator() override
Destructor.
virtual const DiscreteVariable & variable(Idx) const final
Returns a const ref to the ith var.
<agrum/BN/generator/simpleCPTGenerator.h>
void incIn(const Instantiation &i)
Operator increment for the variables in i.
Class for assigning/browsing values to tuples of discrete variables.
virtual void set(const Instantiation &i, const GUM_SCALAR &value) const final
Default implementation of MultiDimContainer::set().
Size Idx
Type for indexes.
void add(const DiscreteVariable &v) final
Adds a new variable in the Instantiation.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
void generateCPT(const Idx &varId, const Potential< GUM_SCALAR > &cpt) override
Generates a CPT using floats.
bool end() const
Returns true if the Instantiation reached the end.
void setFirstOut(const Instantiation &i)
Assign the first values in the Instantiation for the variables not in i.