aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
gum::MultiDimContainer< GUM_ELEMENT > Class Template Referenceabstract

Abstract base class for all multi dimensionnal containers. More...

#include <agrum/base/multidim/multiDimContainer.h>

Inheritance diagram for gum::MultiDimContainer< GUM_ELEMENT >:
Collaboration diagram for gum::MultiDimContainer< GUM_ELEMENT >:

Public Member Functions

Constructors / Destructors
 MultiDimContainer ()
 Default constructor.
 MultiDimContainer (const MultiDimContainer< GUM_ELEMENT > &src)
 Copy constructor.
MultiDimContaineroperator= (const MultiDimContainer< GUM_ELEMENT > &src)
 Default constructor.
 MultiDimContainer (MultiDimContainer< GUM_ELEMENT > &&)
 Class move constructor.
MultiDimContaineroperator= (MultiDimContainer< GUM_ELEMENT > &&src)
 Default constructor.
 ~MultiDimContainer () override
 Destructor.
Accessors / Modifiers
virtual void set (const Instantiation &i, const GUM_ELEMENT &value) const
 Changes the value pointed by i.
virtual GUM_ELEMENT get (const Instantiation &i) const
 Returns the value pointed by i.
GUM_ELEMENT operator[] (const Instantiation &i) const
 An [] operator using a Instantiation as argument.
virtual void fill (const GUM_ELEMENT &d) const =0
 Fill the table with d.
virtual void populate (const std::vector< GUM_ELEMENT > &v) const
 Automatically fills this MultiDimContainer with the values in v.
virtual void populate (std::initializer_list< GUM_ELEMENT > l) const
 Automatically fills this MultiDimContainer with the values in l.
Copy methods.
virtual void copyFrom (const MultiDimContainer< GUM_ELEMENT > &src) const
 Basic copy of a MultiDimContainer.
virtual void copyFrom (const MultiDimContainer< GUM_ELEMENT > &src, Instantiation *p_i) const
 Basic copy of a MultiDimContainer.
virtual void extractFrom (const MultiDimContainer< GUM_ELEMENT > &src, const Instantiation &mask)
 Basic extraction of a MultiDimContainer.
virtual const MultiDimImplementation< GUM_ELEMENT > * content () const =0
 Returns the implementation for this object (may be *this).
virtual MultiDimImplementation< GUM_ELEMENT > * content ()=0
 Returns the implementation for this object (may be *this).
MultiDimAdressablegetMasterRef () override
 In order to insure the dereference for decorators, we need to virtualize the access to master pointer.
const MultiDimAdressablegetMasterRef () const override
 In order to insure the dereference for decorators, we need to virtualize the access to master pointer.
virtual void copy (const MultiDimContainer< GUM_ELEMENT > &src)
 Removes all variables in this MultiDimContainer and copy the content of src, variables included.
virtual MultiDimContainer< GUM_ELEMENT > * newFactory () const =0
 Creates an empty clone of this MultiDimContainer.
Various methods.
virtual std::string toString () const
 Returns a representation of this MultiDimContainer.
std::string toString (const Instantiation *i) const override=0
 Display the internal representation of i.
bool operator== (const MultiDimContainer< GUM_ELEMENT > &p) const
 Test if this MultiDimContainer is equal to p.
virtual void apply (std::function< GUM_ELEMENT(GUM_ELEMENT) > f) const
 Apply a function on every element of the container.
virtual GUM_ELEMENT reduce (std::function< GUM_ELEMENT(GUM_ELEMENT, GUM_ELEMENT) > f, GUM_ELEMENT base) const
 compute lfold for this container
Fast large modifications in structures.
virtual void beginMultipleChanges ()=0
 Call this method before doing important changes in this MultiDimContainer.
virtual void endMultipleChanges ()=0
 Call this method after doing important changes in this MultiDimContainer.
virtual void endMultipleChanges (const GUM_ELEMENT &v)=0
 Call this method after doing important changes in this MultiDimContainer.
Slave management and extension due to slave management
virtual bool registerSlave (Instantiation &i)=0
 Register i as a slave of this MultiDimAdressable.
virtual bool unregisterSlave (Instantiation &i)=0
 Unregister i as a slave of this MultiDimAdressable.
virtual void changeNotification (const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval)=0
 Listen to changes in a given Instantiation.
virtual void setFirstNotification (const Instantiation &i)=0
 Listen to setFirst in a given Instantiation.
virtual void setLastNotification (const Instantiation &i)=0
 Listen to setLast in a given Instantiation.
virtual void setIncNotification (const Instantiation &i)=0
 Listen to increment in a given Instantiation.
virtual void setDecNotification (const Instantiation &i)=0
 Listen to increment in each recorded Instantiation.
virtual void setChangeNotification (const Instantiation &i)=0
 Listen to an assignment of a value in a Instantiation.
Accessors / Modifiers
virtual Idx nbrDim () const =0
 Returns the number of vars in the multidimensional container.
virtual Size domainSize () const =0
 Returns the product of the variables domain size.
virtual void add (const DiscreteVariable &v)=0
 Adds a new var to the variables of the multidimensional matrix.
virtual void erase (const DiscreteVariable &v)=0
 Removes a var from the variables of the multidimensional matrix.
virtual const Sequence< const DiscreteVariable * > & variablesSequence () const =0
 Returns a const ref to the sequence of DiscreteVariable*.
virtual const DiscreteVariablevariable (Idx i) const =0
 Returns a const ref to the ith var.
virtual const DiscreteVariablevariable (std::string_view name) const =0
 Returns the variable with the name.
virtual Idx pos (const DiscreteVariable &v) const =0
 Returns the index of a variable.
virtual bool contains (const DiscreteVariable &v) const =0
 Returns true if var is in *this.
virtual bool empty () const =0
 Returns true if no var is in *this.
void replace (const DiscreteVariable &x, const DiscreteVariable &y)
 Replace variables in this multidim.

Protected Member Functions

virtual GUM_ELEMENT & get_ (const Instantiation &i) const =0
 Return a data, given a Instantiation.
virtual void replace_ (const DiscreteVariable *x, const DiscreteVariable *y)=0
 This is called by MultiDimContainer::replace() to proceed with the replacing between x and y.

Detailed Description

template<typename GUM_ELEMENT>
class gum::MultiDimContainer< GUM_ELEMENT >

Abstract base class for all multi dimensionnal containers.

The MultiDimContainer is an abstract base class for all multi dimensionnal container of GUM_ELEMENT. Its purpose is to deal with GUM_ELEMENT access with no regard to how the storage is done (tree, matrix...).

MultiDimContainer is considered as const if its dimension does not change. Contained values may change even in a const MultiDimContainer :

LabelizedVariable v( "v" ,"v" , 3);
LabelizedVariable w( "w" ,"w" , 3);
{
t<<v;
Instantiation I( t );I.setFirst();
t[I]='a';
}
{
notconst_t<<w;
Instantiation I( notconst_t );I.setFirst();
notconst_t[I]='b';
}
{
const MultiDimContainer<char>& const_t=t;
Instantiation I( const_t );I.setFirst();
// const_t<<w; : ******************** DOES NOT COMPILE : YOU CANNOT DO THIS
!!!!
const_t[I]='c';
}
Class for assigning/browsing values to tuples of discrete variables.
class LabelizedVariable
Multidimensional matrix stored as an array in memory.
Abstract base class for all multi dimensionnal containers.
MultiDimContainer()
Default constructor.
Template Parameters
GUM_ELEMENTThe type of the scalar stored in this multidimensional matrix.

Definition at line 113 of file multiDimContainer.h.

Constructor & Destructor Documentation

◆ MultiDimContainer() [1/3]

template<typename GUM_ELEMENT>
gum::MultiDimContainer< GUM_ELEMENT >::MultiDimContainer ( )

Default constructor.

Definition at line 67 of file multiDimContainer_tpl.h.

References gum::MultiDimAdressable::MultiDimAdressable(), and MultiDimContainer().

Referenced by MultiDimContainer(), MultiDimContainer(), MultiDimContainer(), gum::MultiDimDecorator< GUM_ELEMENT >::MultiDimDecorator(), gum::MultiDimDecorator< GUM_ELEMENT >::MultiDimDecorator(), gum::MultiDimImplementation< GUM_ELEMENT >::MultiDimImplementation(), gum::MultiDimImplementation< GUM_ELEMENT >::MultiDimImplementation(), ~MultiDimContainer(), gum::aggregator::MultiDimAggregator< GUM_ELEMENT >::aggregatorName(), gum::MultiDimDecorator< GUM_ELEMENT >::apply(), gum::MultiDimDecorator< GUM_ELEMENT >::beginMultipleChanges(), gum::MultiDimDecorator< GUM_ELEMENT >::changeNotification(), content(), copy(), copyFrom(), copyFrom(), gum::MultiDimDecorator< GUM_ELEMENT >::domainSize(), gum::MultiDimDecorator< GUM_ELEMENT >::empty(), gum::MultiDimDecorator< GUM_ELEMENT >::endMultipleChanges(), gum::MultiDimDecorator< GUM_ELEMENT >::endMultipleChanges(), gum::MultiDimDecorator< GUM_ELEMENT >::erase(), extractFrom(), fill(), gum::MultiDimDecorator< GUM_ELEMENT >::fill(), gum::MultiDimDecorator< GUM_ELEMENT >::get(), gum::MultiDimDecorator< GUM_ELEMENT >::nbrDim(), gum::aggregator::MultiDimAggregator< GUM_ELEMENT >::newFactory(), newFactory(), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *)::newFactory(), operator=(), operator=(), gum::MultiDimDecorator< GUM_ELEMENT >::operator=(), operator==(), gum::MultiDimDecorator< GUM_ELEMENT >::populate(), gum::MultiDimDecorator< GUM_ELEMENT >::pos(), gum::MultiDimDecorator< GUM_ELEMENT >::reduce(), gum::MultiDimDecorator< GUM_ELEMENT >::registerSlave(), gum::MultiDimDecorator< GUM_ELEMENT >::set(), gum::MultiDimDecorator< GUM_ELEMENT >::setChangeNotification(), gum::MultiDimDecorator< GUM_ELEMENT >::setDecNotification(), gum::MultiDimDecorator< GUM_ELEMENT >::setFirstNotification(), gum::MultiDimDecorator< GUM_ELEMENT >::setIncNotification(), gum::MultiDimDecorator< GUM_ELEMENT >::setLastNotification(), toString(), gum::MultiDimDecorator< GUM_ELEMENT >::toString(), gum::MultiDimDecorator< GUM_ELEMENT >::unregisterSlave(), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *)::unregisterSlave(), gum::MultiDimDecorator< GUM_ELEMENT >::variable(), gum::MultiDimDecorator< GUM_ELEMENT >::variable(), and gum::MultiDimDecorator< GUM_ELEMENT >::variablesSequence().

Here is the call graph for this function:

◆ MultiDimContainer() [2/3]

template<typename GUM_ELEMENT>
gum::MultiDimContainer< GUM_ELEMENT >::MultiDimContainer ( const MultiDimContainer< GUM_ELEMENT > & src)

Copy constructor.

Parameters
srcThe MultiDimContainer to copy.

Definition at line 73 of file multiDimContainer_tpl.h.

References gum::MultiDimAdressable::MultiDimAdressable(), and MultiDimContainer().

Here is the call graph for this function:

◆ MultiDimContainer() [3/3]

template<typename GUM_ELEMENT>
gum::MultiDimContainer< GUM_ELEMENT >::MultiDimContainer ( MultiDimContainer< GUM_ELEMENT > && from)

Class move constructor.

Definition at line 60 of file multiDimContainer_tpl.h.

References gum::MultiDimAdressable::MultiDimAdressable(), and MultiDimContainer().

Here is the call graph for this function:

◆ ~MultiDimContainer()

template<typename GUM_ELEMENT>
gum::MultiDimContainer< GUM_ELEMENT >::~MultiDimContainer ( )
override

Destructor.

Definition at line 96 of file multiDimContainer_tpl.h.

References MultiDimContainer().

Here is the call graph for this function:

Member Function Documentation

◆ add()

virtual void gum::MultiDimInterface::add ( const DiscreteVariable & v)
pure virtualinherited

Adds a new var to the variables of the multidimensional matrix.

See also
operator<<(MultiDimInterface& c, const DiscreteVariable& v)
Warning
Note that the variable passed in argument is not duplicated, that is, only a pointer toward the variable is kept by the MultiDimInterface.
Parameters
vThe new var.
Exceptions
DuplicateElementRaised if the variable already belongs to the sequence of variables.
OperationNotAllowedRaised if this object is non mutable.

Implemented in gum::Instantiation, gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimImplementation< GUM_ELEMENT >, gum::MultiDimImplementation< bool >, gum::MultiDimImplementation< double >, gum::MultiDimImplementation< gum::ActionSet >, gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const HashTable< const DiscreteVariable *, Idx > &), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *), gum::MultiDimImplementation< GUM_SCALAR >, gum::MultiDimImplementation< Size >, gum::MultiDimImplementation< std::string >, gum::MultiDimSparse< GUM_ELEMENT >, gum::MultiDimWithOffset< GUM_ELEMENT >, and gum::VariableSet &)< GUM_ELEMENT >.

Referenced by gum::MultiDimContainer< GUM_ELEMENT >::copy(), and gum::operator<<().

Here is the caller graph for this function:

◆ apply()

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::apply ( std::function< GUM_ELEMENT(GUM_ELEMENT) > f) const
virtual

Apply a function on every element of the container.

Parameters
fthe function to apply

Reimplemented in gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, and gum::MultiDimDecorator< GUM_SCALAR >.

Definition at line 200 of file multiDimContainer_tpl.h.

200 {
201 Instantiation i(*this);
202 for (i.setFirst(); !i.end(); ++i) {
203 set(i, f(get(i)));
204 }
205 }
virtual void set(const Instantiation &i, const GUM_ELEMENT &value) const
Changes the value pointed by i.
virtual GUM_ELEMENT get(const Instantiation &i) const
Returns the value pointed by i.

References gum::Instantiation::end(), get(), set(), and gum::Instantiation::setFirst().

Here is the call graph for this function:

◆ beginMultipleChanges()

◆ changeNotification()

◆ contains()

◆ content() [1/2]

◆ content() [2/2]

template<typename GUM_ELEMENT>
virtual MultiDimImplementation< GUM_ELEMENT > * gum::MultiDimContainer< GUM_ELEMENT >::content ( )
pure virtual

◆ copy()

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::copy ( const MultiDimContainer< GUM_ELEMENT > & src)
virtual

Removes all variables in this MultiDimContainer and copy the content of src, variables included.

Parameters
srcThe MultiDimContainer to copy.

Reimplemented in gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, and gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >.

Definition at line 284 of file multiDimContainer_tpl.h.

284 {
285 this->beginMultipleChanges();
286
287 Size nbr = this->nbrDim();
288
289 for (Idx i = 0; i < nbr; i++) {
290 this->erase(this->variable(0));
291 }
292
293 for (Idx i = 0; i < src.nbrDim(); i++) {
294 this->add(src.variable(i));
295 }
296
297 this->endMultipleChanges();
298 this->copyFrom(src);
299 }
virtual void beginMultipleChanges()=0
Call this method before doing important changes in this MultiDimContainer.
virtual void copyFrom(const MultiDimContainer< GUM_ELEMENT > &src) const
Basic copy of a MultiDimContainer.
virtual void endMultipleChanges()=0
Call this method after doing important changes in this MultiDimContainer.
virtual void add(const DiscreteVariable &v)=0
Adds a new var to the variables of the multidimensional matrix.
virtual Idx nbrDim() const =0
Returns the number of vars in the multidimensional container.
virtual const DiscreteVariable & variable(Idx i) const =0
Returns a const ref to the ith var.
virtual void erase(const DiscreteVariable &v)=0
Removes a var from the variables of the multidimensional matrix.

References MultiDimContainer(), gum::MultiDimInterface::add(), beginMultipleChanges(), endMultipleChanges(), gum::MultiDimInterface::erase(), gum::MultiDimInterface::nbrDim(), and gum::MultiDimInterface::variable().

Referenced by gum::TreeRegress< GUM_ELEMENT, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::compute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFrom() [1/2]

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::copyFrom ( const MultiDimContainer< GUM_ELEMENT > & src) const
virtual

Basic copy of a MultiDimContainer.

This method is virtual because it should be optimized in certain MultiDimContainer.

Parameters
srcThe MultiDimContainer src which values are copied. This is a full copy with no verification of dimensions.
Exceptions
OperationNotAllowedRaised if src does not have the same domain size than this MultiDimContainer.

Reimplemented in gum::aggregator::MultiDimAggregator< GUM_ELEMENT >, gum::aggregator::MultiDimAggregator< GUM_SCALAR >, gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimICIModel< GUM_ELEMENT >, and gum::MultiDimICIModel< GUM_SCALAR >.

Definition at line 266 of file multiDimContainer_tpl.h.

267 {
268 if (src.domainSize() != domainSize()) {
270 "Domain sizes do not fit : " << src.domainSize() << "!=" << domainSize());
271 }
272
273 Instantiation i_dest(*this);
275
276 for (i_dest.setFirst(), i_src.setFirst(); !i_dest.end(); ++i_dest, ++i_src) {
277 set(i_dest, src[i_src]);
278 }
279 }
virtual Size domainSize() const =0
Returns the product of the variables domain size.
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References MultiDimContainer(), gum::MultiDimInterface::domainSize(), gum::Instantiation::end(), GUM_ERROR, set(), and gum::Instantiation::setFirst().

Referenced by gum::Tensor< GUM_SCALAR >::Tensor(), gum::MultiDimArray< GUM_ELEMENT >::copyFrom(), and gum::MultiDimICIModel< GUM_SCALAR >::externalWeight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFrom() [2/2]

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::copyFrom ( const MultiDimContainer< GUM_ELEMENT > & src,
Instantiation * p_i ) const
virtual

Basic copy of a MultiDimContainer.

This method is virtual because it should be optimized in certain MultiDimContainer.

Parameters
srcThe MultiDimContainer src which values are copied.
p_iGive the order to iterate in this MultiDimContainer during the copy (nullptr will correctly copy if this is a reorganization of src).
Exceptions
OperationNotAllowedRaised if src does not have the same domain size than this MultiDimContainer.

Reimplemented in gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, and gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >.

Definition at line 220 of file multiDimContainer_tpl.h.

221 {
222 if (src.domainSize() != domainSize()) {
224 "Domain sizes do not fit : " << src.domainSize() << "!=" << domainSize());
225 }
226
227 if (p_i == nullptr) { // if null, we just follow the same order
229 for (i.setFirst(); !i.end(); ++i) {
230 set(i, src[i]);
231 }
232 } else {
233 Instantiation i_dest(*this);
235 for (i_dest.setFirst(), i_src.setFirst(); !i_dest.end(); i_dest.incIn(*p_i), ++i_src) {
236 set(i_dest, src[i_src]);
237 }
238 }
239 }

References MultiDimContainer(), gum::MultiDimInterface::domainSize(), gum::Instantiation::end(), GUM_ERROR, and gum::Instantiation::setFirst().

Here is the call graph for this function:

◆ domainSize()

◆ empty()

◆ endMultipleChanges() [1/2]

◆ endMultipleChanges() [2/2]

◆ erase()

virtual void gum::MultiDimInterface::erase ( const DiscreteVariable & v)
pure virtualinherited

Removes a var from the variables of the multidimensional matrix.

See also
operator>>(MultiDimInterface& c, const DiscreteVariable& v)
Exceptions
OperationNotAllowedRaised if this object is non mutable.
NotFoundRaised if v does not belong to this.

Implemented in gum::Instantiation, gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimImplementation< GUM_ELEMENT >, gum::MultiDimImplementation< bool >, gum::MultiDimImplementation< double >, gum::MultiDimImplementation< gum::ActionSet >, gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const HashTable< const DiscreteVariable *, Idx > &), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *), gum::MultiDimImplementation< GUM_SCALAR >, gum::MultiDimImplementation< Size >, gum::MultiDimImplementation< std::string >, gum::MultiDimSparse< GUM_ELEMENT >, gum::MultiDimWithOffset< GUM_ELEMENT >, and gum::VariableSet &)< GUM_ELEMENT >.

Referenced by gum::MultiDimContainer< GUM_ELEMENT >::copy(), gum::MultiDimContainer< GUM_ELEMENT >::extractFrom(), and gum::operator>>().

Here is the caller graph for this function:

◆ extractFrom()

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::extractFrom ( const MultiDimContainer< GUM_ELEMENT > & src,
const Instantiation & mask )
virtual

Basic extraction of a MultiDimContainer.

This method is virtual because it should be optimized in certain MultiDimContainer.

Parameters
srcThe MultiDimContainer src which datas are copied.
maskpartial instantiation of variables of the Tensor : the

extraction will concern every variable not in the instantiation and the copy of data will use the (relevant) values in this instantiation.

Definition at line 242 of file multiDimContainer_tpl.h.

243 {
244 this->beginMultipleChanges();
245
246 Size nbr = this->nbrDim();
247 for (Idx i = 0; i < nbr; i++) {
248 this->erase(this->variable(0));
249 }
250
251 for (Idx i = 0; i < src.nbrDim(); i++) {
252 if (!imask.contains(src.variable(i))) this->add(src.variable(i));
253 }
254
255 this->endMultipleChanges();
256
257 if (this->nbrDim() == 0) { GUM_ERROR(FatalError, "Empty tensor") }
258
260 inst.setVals(imask);
261 for (inst.setFirstOut(imask); !inst.end(); inst.incOut(imask))
262 set(inst, src[inst]);
263 }
virtual bool contains(const DiscreteVariable &v) const =0
Returns true if var is in *this.

References MultiDimContainer(), beginMultipleChanges(), gum::MultiDimInterface::erase(), gum::MultiDimInterface::nbrDim(), and gum::MultiDimInterface::variable().

Here is the call graph for this function:

◆ fill()

◆ get()

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::MultiDimContainer< GUM_ELEMENT >::get ( const Instantiation & i) const
virtual

Returns the value pointed by i.

Warning
If i variables set is disjoint with this MultiDimContainer then 0 is assumed for dimensions (i.e. variables) not present in the instantiation.
Parameters
iAn Instantiation of this MultiDimContainer.
Returns
Returns the value pointe by i.

Reimplemented in gum::aggregator::MultiDimAggregator< GUM_ELEMENT >, gum::aggregator::MultiDimAggregator< GUM_SCALAR >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimLogit< GUM_SCALAR >, gum::MultiDimNoisyAND< GUM_SCALAR >, gum::MultiDimNoisyORCompound< GUM_SCALAR >, gum::MultiDimNoisyORNet< GUM_SCALAR >, and gum::MultiDimSparse< GUM_ELEMENT >.

Definition at line 118 of file multiDimContainer_tpl.h.

118 {
119 return get_(i);
120 }
virtual GUM_ELEMENT & get_(const Instantiation &i) const =0
Return a data, given a Instantiation.

References get_().

Referenced by apply(), and operator[]().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_()

template<typename GUM_ELEMENT>
virtual GUM_ELEMENT & gum::MultiDimContainer< GUM_ELEMENT >::get_ ( const Instantiation & i) const
protectedpure virtual

Return a data, given a Instantiation.

Note that get allows to change a value in the container. The method is tagged as const since a multidim is not const if its dimension changed.

Warning
If i variables set is disjoint with this MultiDimContainer then 0 is assumed for dimensions (i.e. variables) not present in the instantiation.
Parameters
iThe instantiation used to find the data.

Implemented in gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimReadOnly< GUM_ELEMENT >, gum::MultiDimReadOnly< GUM_SCALAR >, gum::MultiDimSparse< GUM_ELEMENT >, and gum::MultiDimWithOffset< GUM_ELEMENT >.

Referenced by get(), and set().

Here is the caller graph for this function:

◆ getMasterRef() [1/2]

template<typename GUM_ELEMENT>
const MultiDimAdressable & gum::MultiDimContainer< GUM_ELEMENT >::getMasterRef ( ) const
overridevirtual

In order to insure the dereference for decorators, we need to virtualize the access to master pointer.

Returns
Returns the master of this MultiDimAdressable.

Implements gum::MultiDimAdressable.

Definition at line 307 of file multiDimContainer_tpl.h.

307 {
308 return static_cast< const MultiDimAdressable& >(*content());
309 }
virtual const MultiDimImplementation< GUM_ELEMENT > * content() const =0
Returns the implementation for this object (may be *this).

References gum::MultiDimAdressable::MultiDimAdressable(), and content().

Here is the call graph for this function:

◆ getMasterRef() [2/2]

template<typename GUM_ELEMENT>
MultiDimAdressable & gum::MultiDimContainer< GUM_ELEMENT >::getMasterRef ( )
overridevirtual

In order to insure the dereference for decorators, we need to virtualize the access to master pointer.

Returns
Returns the ref to content as MultiDimAdressable&

Implements gum::MultiDimAdressable.

Definition at line 302 of file multiDimContainer_tpl.h.

302 {
303 return static_cast< MultiDimAdressable& >(*content());
304 }

References gum::MultiDimAdressable::MultiDimAdressable(), and content().

Here is the call graph for this function:

◆ nbrDim()

◆ newFactory()

template<typename GUM_ELEMENT>
virtual MultiDimContainer< GUM_ELEMENT > * gum::MultiDimContainer< GUM_ELEMENT >::newFactory ( ) const
nodiscardpure virtual

Creates an empty clone of this MultiDimContainer.

This method creates a clone of this object, withouth its content (including variable), you must use this method if you want to ensure that the generated object has the same type than the object containing the called newFactory() For example :

MultiDimContainer< GUM_ELEMENT > * newFactory() const override
Default constructor.

Then x is a MultiDimArray<double>*.

Warning
You must free by yourself the returned pointer.
Returns
Returns an empty clone of this object with the same type.

Implemented in gum::aggregator::Amplitude< GUM_SCALAR >, gum::aggregator::And< GUM_SCALAR >, gum::aggregator::Count< GUM_SCALAR >, gum::aggregator::Exists< GUM_SCALAR >, gum::aggregator::Forall< GUM_SCALAR >, gum::aggregator::Max< GUM_SCALAR >, gum::aggregator::Median< GUM_SCALAR >, gum::aggregator::Min< GUM_SCALAR >, gum::aggregator::MultiDimAggregator< GUM_ELEMENT >, gum::aggregator::MultiDimAggregator< GUM_SCALAR >, gum::aggregator::Or< GUM_SCALAR >, gum::aggregator::Sum< GUM_SCALAR >, gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimImplementation< GUM_ELEMENT >, gum::MultiDimImplementation< bool >, gum::MultiDimImplementation< double >, gum::MultiDimImplementation< gum::ActionSet >, gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const HashTable< const DiscreteVariable *, Idx > &), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *), gum::MultiDimImplementation< GUM_SCALAR >, gum::MultiDimImplementation< Size >, gum::MultiDimImplementation< std::string >, gum::MultiDimLogit< GUM_SCALAR >, gum::MultiDimNoisyAND< GUM_SCALAR >, gum::MultiDimNoisyORCompound< GUM_SCALAR >, gum::MultiDimNoisyORNet< GUM_SCALAR >, gum::MultiDimReadOnly< GUM_ELEMENT >, gum::MultiDimReadOnly< GUM_SCALAR >, gum::MultiDimSparse< GUM_ELEMENT >, gum::MultiDimWithOffset< GUM_ELEMENT >, gum::Tensor< GUM_SCALAR >, gum::Tensor< GUM_ELEMENT >, and gum::VariableSet &)< GUM_ELEMENT >.

References MultiDimContainer().

Here is the call graph for this function:

◆ operator=() [1/2]

template<typename GUM_ELEMENT>
MultiDimContainer< GUM_ELEMENT > & gum::MultiDimContainer< GUM_ELEMENT >::operator= ( const MultiDimContainer< GUM_ELEMENT > & src)

Default constructor.

Definition at line 80 of file multiDimContainer_tpl.h.

80 {
82 return *this;
83 }
MultiDimAdressable & operator=(const MultiDimAdressable &from)
Default constructor.

References MultiDimContainer(), and gum::MultiDimAdressable::operator=().

Referenced by gum::MultiDimDecorator< GUM_ELEMENT >::operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/2]

template<typename GUM_ELEMENT>
MultiDimContainer< GUM_ELEMENT > & gum::MultiDimContainer< GUM_ELEMENT >::operator= ( MultiDimContainer< GUM_ELEMENT > && src)

Default constructor.

Definition at line 87 of file multiDimContainer_tpl.h.

References MultiDimContainer(), and gum::MultiDimAdressable::operator=().

Here is the call graph for this function:

◆ operator==()

template<typename GUM_ELEMENT>
bool gum::MultiDimContainer< GUM_ELEMENT >::operator== ( const MultiDimContainer< GUM_ELEMENT > & p) const

Test if this MultiDimContainer is equal to p.

Parameters
pThe MultiDimContainer to test for equality.
Returns
Returns true if this MultiDimContainer is equal to p.

Definition at line 148 of file multiDimContainer_tpl.h.

149 {
150 if ((nbrDim() == p.nbrDim()) && (domainSize() == p.domainSize())) {
151 if (nbrDim() == 0) return true;
152
153 for (auto iter = variablesSequence().beginSafe(); iter != variablesSequence().endSafe();
154 ++iter) {
155 if (!p.variablesSequence().exists(*iter)) { return false; }
156 }
157 } else {
158 return false;
159 }
160
161 Instantiation i(*this);
163 for (i.setFirst(); !i.end(); ++i) {
164 if (cmp(get(i), p.get(i))) { return false; }
165 }
166
167 return true;
168 }
virtual const Sequence< const DiscreteVariable * > & variablesSequence() const =0
Returns a const ref to the sequence of DiscreteVariable*.

References MultiDimContainer(), gum::MultiDimInterface::domainSize(), gum::MultiDimInterface::nbrDim(), and gum::MultiDimInterface::variablesSequence().

Here is the call graph for this function:

◆ operator[]()

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::MultiDimContainer< GUM_ELEMENT >::operator[] ( const Instantiation & i) const

An [] operator using a Instantiation as argument.

Warning
If i variables set is disjoint with this MultiDimContainer then 0 is assumed for dimensions (i.e. variables) not prensent in the instantiation.
Parameters
iAn Instantiation.
Returns
Returns the adressed (GUM_ELEMENT) value.

Definition at line 103 of file multiDimContainer_tpl.h.

103 {
104 return get(i);
105 }

References get().

Here is the call graph for this function:

◆ populate() [1/2]

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::populate ( const std::vector< GUM_ELEMENT > & v) const
virtual

Automatically fills this MultiDimContainer with the values in v.

The order used to fill this MultiDimContainer is the same as with an instantiation over it.

Size cpt = 0;
Instantiation i( *this );
for (i.setFirst(); !i.end(); ++i, ++cpt) {
set(i, v[cpt]);
}
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
Parameters
vVector of values.
Exceptions
SizeErrorRaised if v size's does not matches this MultiDimContainer domain size.

Reimplemented in gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, and gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >.

Definition at line 172 of file multiDimContainer_tpl.h.

172 {
173 if (domainSize() != v.size()) {
174 GUM_ERROR(SizeError, "Sizes do not match : " << domainSize() << "!=" << v.size())
175 }
176
177 Size cpt = 0;
178
179 Instantiation i(*this);
180
181 for (i.setFirst(); !i.end(); ++i, ++cpt)
182 set(i, v[cpt]);
183 }

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByLines().

Here is the caller graph for this function:

◆ populate() [2/2]

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::populate ( std::initializer_list< GUM_ELEMENT > l) const
virtual

Automatically fills this MultiDimContainer with the values in l.

The order used to fill this MultiDimContainer is the same as with an instantiation over it.

Size cpt = 0;
Instantiation i( *this );
for (i.setFirst(); !i.end(); ++i, ++cpt) {
set(i, v[cpt]);
}
Parameters
lcontains the data.
Exceptions
SizeErrorRaised if l size's does not matches this MultiDimContainer domain size.

Reimplemented in gum::MultiDimBijArray< GUM_ELEMENT >, and gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >.

Definition at line 186 of file multiDimContainer_tpl.h.

186 {
187 if (domainSize() != l.size()) {
188 GUM_ERROR(SizeError, "Sizes do not match : " << domainSize() << "!=" << l.size())
189 }
190
191 Instantiation i(*this);
192 // insert all the elements
193 for (const auto& elt: l) {
194 set(i, elt);
195 ++i;
196 }
197 }

References gum::MultiDimInterface::domainSize(), GUM_ERROR, and set().

Here is the call graph for this function:

◆ pos()

◆ reduce()

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::MultiDimContainer< GUM_ELEMENT >::reduce ( std::function< GUM_ELEMENT(GUM_ELEMENT, GUM_ELEMENT) > f,
GUM_ELEMENT base ) const
virtual

compute lfold for this container

Parameters
fthe function to apply
basethe initial value

Reimplemented in gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, and gum::MultiDimDecorator< GUM_SCALAR >.

Definition at line 208 of file multiDimContainer_tpl.h.

210 {
212 Instantiation i(*this);
213 for (i.setFirst(); !i.end(); ++i) {
214 tmp = f(tmp, get(i));
215 }
216 return tmp;
217 }

◆ registerSlave()

◆ replace()

INLINE void gum::MultiDimInterface::replace ( const DiscreteVariable & x,
const DiscreteVariable & y )
inherited

Replace variables in this multidim.

If x is in this MultiDim and y has the same domain size, then x will be replace by y in this MultiDim.

Parameters
xThe variable in this which will be replaced.
yThe variable replacing y.
Exceptions
NotFoundRaised if x does not belong to this MultiDim.
OperationNotAllowedIf y and x are not interchangeable.
DuplicateElementIf y is already in this MultiDim.

Definition at line 57 of file multiDimInterface_inl.h.

57 {
58 if (!contains(x)) { GUM_ERROR(NotFound, "could not find the variable") }
59
60 if (contains(y)) { GUM_ERROR(DuplicateElement, "variable " << y << " already in MultiDim") }
61
62 if (x.domainSize() != y.domainSize()) {
63 GUM_ERROR(OperationNotAllowed, "incompatible variables")
64 }
65
66 replace_(&x, &y);
67 }
virtual void replace_(const DiscreteVariable *x, const DiscreteVariable *y)=0
This is called by MultiDimContainer::replace() to proceed with the replacing between x and y.

References contains(), gum::DiscreteVariable::domainSize(), GUM_ERROR, and replace_().

Here is the call graph for this function:

◆ replace_()

virtual void gum::MultiDimInterface::replace_ ( const DiscreteVariable * x,
const DiscreteVariable * y )
protectedpure virtualinherited

This is called by MultiDimContainer::replace() to proceed with the replacing between x and y.

This is called only when everything have been checked.

Parameters
xThe variable to replace in
yThe second variable to swap.

Implemented in gum::Instantiation, gum::MultiDimArray< GUM_ELEMENT >, gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimICIModel< GUM_ELEMENT >, gum::MultiDimICIModel< GUM_SCALAR >, gum::MultiDimImplementation< GUM_ELEMENT >, gum::MultiDimImplementation< bool >, gum::MultiDimImplementation< double >, gum::MultiDimImplementation< gum::ActionSet >, gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const HashTable< const DiscreteVariable *, Idx > &), gum::MultiDimImplementation< GUM_ELEMENT > *(*)(const MultiDimImplementation< GUM_ELEMENT > *, const MultiDimImplementation< GUM_ELEMENT > *), gum::MultiDimImplementation< GUM_SCALAR >, gum::MultiDimImplementation< Size >, gum::MultiDimImplementation< std::string >, gum::MultiDimSparse< GUM_ELEMENT >, and gum::VariableSet &)< GUM_ELEMENT >.

Referenced by replace().

Here is the caller graph for this function:

◆ set()

template<typename GUM_ELEMENT>
void gum::MultiDimContainer< GUM_ELEMENT >::set ( const Instantiation & i,
const GUM_ELEMENT & value ) const
virtual

Changes the value pointed by i.

Warning
If i variables set is disjoint with this MultiDimContainer then 0 is assumed for dimensions (i.e. variables) not prensent in the instantiation.
Parameters
iAn Instantiation of this MultiDimContainer.
valueThe new value.

Reimplemented in gum::MultiDimBijArray< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_SCALAR >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< bool >, gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< double >, gum::MultiDimFunctionGraph< double, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< gum::ActionSet, gum::SetTerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimFunctionGraph< Size >, gum::MultiDimFunctionGraph< Size, ExactTerminalNodePolicy >, gum::MultiDimReadOnly< GUM_ELEMENT >, gum::MultiDimReadOnly< GUM_SCALAR >, and gum::MultiDimSparse< GUM_ELEMENT >.

Definition at line 110 of file multiDimContainer_tpl.h.

111 {
112 get_(i) = value;
113 }

References get_().

Referenced by apply(), copyFrom(), and populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChangeNotification()

◆ setDecNotification()

◆ setFirstNotification()

◆ setIncNotification()

◆ setLastNotification()

◆ toString() [1/2]

template<typename GUM_ELEMENT>
std::string gum::MultiDimContainer< GUM_ELEMENT >::toString ( ) const
virtual

Returns a representation of this MultiDimContainer.

Returns
Returns a representation of this MultiDimContainer.

Reimplemented in gum::aggregator::MultiDimAggregator< GUM_ELEMENT >, gum::aggregator::MultiDimAggregator< GUM_SCALAR >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimICIModel< GUM_ELEMENT >, gum::MultiDimICIModel< GUM_SCALAR >, gum::MultiDimLogit< GUM_SCALAR >, gum::MultiDimNoisyAND< GUM_SCALAR >, gum::MultiDimNoisyORCompound< GUM_SCALAR >, gum::MultiDimNoisyORNet< GUM_SCALAR >, gum::Tensor< GUM_SCALAR >, and gum::Tensor< GUM_ELEMENT >.

Definition at line 125 of file multiDimContainer_tpl.h.

125 {
126 // we create a new instantiation and iterate over it to display the whole
127 // content of the array
128 if (this->nbrDim() == 0) { return "[]"; }
129
131 Instantiation inst(const_cast< MultiDimContainer* >(this));
132
133 bool first = true;
134
135 for (inst.setFirst(); !inst.end(); ++inst) {
136 if (!first) { ss << " /"; }
137 first = false;
138
139 ss << inst << " :: " << get(inst);
140 }
141
142 return ss.str();
143 }

References gum::MultiDimInterface::nbrDim().

Referenced by gum::MultiDimContainer< double >::copy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString() [2/2]

template<typename GUM_ELEMENT>
std::string gum::MultiDimContainer< GUM_ELEMENT >::toString ( const Instantiation * i) const
overridepure virtual

Display the internal representation of i.

Returns
Returns an internal representation of i.

Implements gum::MultiDimAdressable.

Implemented in gum::aggregator::MultiDimAggregator< GUM_ELEMENT >, gum::MultiDimBucket< GUM_ELEMENT >, gum::MultiDimDecorator< GUM_ELEMENT >, gum::MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy >, gum::MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy >, gum::MultiDimICIModel< GUM_ELEMENT >, and gum::MultiDimWithOffset< GUM_ELEMENT >.

References MultiDimContainer().

Here is the call graph for this function:

◆ unregisterSlave()

◆ variable() [1/2]

◆ variable() [2/2]

virtual const DiscreteVariable & gum::MultiDimInterface::variable ( std::string_view name) const
pure virtualinherited

◆ variablesSequence()


The documentation for this class was generated from the following files: