28 template <
typename GUM_SCALAR >
48 }
else if (
dynamic_cast< 75 "encountered an unexpected MultiDim implementation");
86 "There is no MultiDimSparse in PRMs, normally...");
91 "encountered an unexpected MultiDim implementation");
104 template <
typename GUM_SCALAR >
110 template <
typename GUM_SCALAR >
121 for (
const auto p : pool)
122 if (p->contains(*var)) pots.
insert(p);
124 if (pots.
size() == 0) {
126 }
else if (pots.
size() == 1) {
136 for (
const auto p : pots) {
149 template <
typename GUM_SCALAR >
153 for (
auto var : elim_order) {
A class to combine efficiently several MultiDim tablesMultiDimCombinationDefault is a class designed ...
aGrUM's Potential is a multi-dimensional array with tensor operators.
const T2 & second(const T1 &first) const
Returns the second value of a pair given its first value.
Decorator of a MultiDimArray, using a bijection over the variables.
virtual void erase(const DiscreteVariable &var) final
Removes a var from the variables of the multidimensional matrix.
A multidim implementation for buckets.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
iterator begin() const
The usual unsafe begin iterator to parse the set.
Abstract base class for all multi dimensionnal read only structure.
<agrum/multidim/aggregators/multiDimAggregator.h>
virtual const MultiDimImplementation< GUM_SCALAR > * content() const final
Returns the implementation for this object (may be *this).
Representation of a setA Set is a structure that contains arbitrary elements.
void compute(bool force=false) const
This method computes the final table of this bucket.
Base class for all aGrUM's exceptions.
Multidimensional matrix stored as an array in memory.
Set of pairs of elements with fast search for both elements.
Potential< GUM_SCALAR > * copyPotential(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bij, const Potential< GUM_SCALAR > &source)
Returns a copy of a Potential after applying a bijection over the variables in source.
void eliminateNode(const DiscreteVariable *var, Set< Potential< GUM_SCALAR > * > &pool, Set< Potential< GUM_SCALAR > * > &trash)
Proceeds with the elimination of var in pool.
Potential< GUM_SCALAR > margSumOut(const Set< const DiscreteVariable * > &del_vars) const
Projection using sum as operation (and implementation-optimized operations)
void eliminateNodes(const std::vector< const DiscreteVariable * > &elim_order, Set< Potential< GUM_SCALAR > * > &pool, Set< Potential< GUM_SCALAR > * > &trash)
virtual const Sequence< const DiscreteVariable *> & variablesSequence() const override
Returns a const ref to the sequence of DiscreteVariable*.
virtual void add(const DiscreteVariable &v) final
Adds a new var to the variables of the multidimensional matrix.
<agrum/multidim/multiDimImplementation.h>
Size size() const noexcept
Returns the number of elements in the set.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const override=0
Creates an empty clone of this MultiDimContainer.
virtual TABLE< GUM_SCALAR > * combine(const Set< const TABLE< GUM_SCALAR > * > &set)
Creates and returns the result of the combination of the tables within set.
void insert(const Key &k)
Inserts a new element into the set.
Multidimensional matrix stored as a sparse array in memory.
#define GUM_ERROR(type, msg)
Potential< GUM_SCALAR > * multPotential(const Potential< GUM_SCALAR > &t1, const Potential< GUM_SCALAR > &t2)