[aGrUM] internal bug fix

parent b250504f
......@@ -915,7 +915,7 @@ namespace gum {
attr.swap(old_type, new_type);
} else {
GUM_ERROR(OperationNotAllowed, "unexpected ClassElement");
// get( child ).cpf().swap(
// get( child ).cpf().replace(
// slotchain->lastElt().type().variable(),
// sc->lastElt().type().variable() );
}
......
......@@ -343,11 +343,11 @@ namespace gum {
PRMFormAttribute< GUM_SCALAR >::swap(const PRMType< GUM_SCALAR >& old_type,
const PRMType< GUM_SCALAR >& new_type) {
if (&(old_type) == __type) {
GUM_ERROR(OperationNotAllowed, "Cannot swap attribute own type");
GUM_ERROR(OperationNotAllowed, "Cannot replace attribute own type");
}
if (old_type->domainSize() != new_type->domainSize()) {
GUM_ERROR(OperationNotAllowed,
"Cannot swap types with difference domain size");
"Cannot replace types with difference domain size");
}
if (!__formulas->contains(old_type.variable())) {
GUM_ERROR(NotFound, "could not find variable " + old_type.name());
......@@ -395,7 +395,7 @@ namespace gum {
if (__type->variable().domainSize() != t->variable().domainSize()) {
GUM_ERROR(OperationNotAllowed,
"Cannot swap types with difference domain size");
"Cannot replace types with difference domain size");
}
auto old = __formulas;
......
......@@ -238,11 +238,11 @@ namespace gum {
PRMScalarAttribute< GUM_SCALAR >::swap(const PRMType< GUM_SCALAR >& old_type,
const PRMType< GUM_SCALAR >& new_type) {
if (&(old_type) == __type) {
GUM_ERROR(OperationNotAllowed, "Cannot swap attribute own type");
GUM_ERROR(OperationNotAllowed, "Cannot replace attribute own type");
}
if (old_type->domainSize() != new_type->domainSize()) {
GUM_ERROR(OperationNotAllowed,
"Cannot swap types with difference domain size");
"Cannot replace types with difference domain size");
}
if (!__cpf->contains(old_type.variable())) {
GUM_ERROR(NotFound, "could not find variable " + old_type.name());
......@@ -285,7 +285,7 @@ namespace gum {
if (__type->variable().domainSize() != t->variable().domainSize()) {
GUM_ERROR(OperationNotAllowed,
"Cannot swap types with difference domain size");
"Cannot replace types with difference domain size");
}
auto old = __cpf;
......
......@@ -2148,7 +2148,7 @@ namespace gum {
return **__getIthBucket(i);
}
// swap the current list with another one
// replace the current list with another one
template < typename Val, typename Alloc >
INLINE void List< Val, Alloc >::swap(List& other_list) {
std::swap(__deb_list, other_list.__deb_list);
......
......@@ -49,7 +49,7 @@ namespace gum {
* @tparam Val The type referenced by both gum::RefPtr.
* @param ptr1 The smart pointer the content of which we swap with that of
* ptr2.
* @param ptr2 The smart pointer the content of which we swap with that of
* @param ptr2 The smart pointer the content of which we replace with that of
* ptr1.
*/
/// @brief Swap the contents of two RefPtr.
......
......@@ -260,7 +260,7 @@ namespace gum {
return __refcount;
}
// swap the contents of two RefPtr
// replace the contents of two RefPtr
template < typename Val >
void swap(RefPtr< Val >& ptr1, RefPtr< Val >& ptr2) {
......
......@@ -546,7 +546,7 @@ namespace gum {
__v[i] = &new_key;
}
// swap two elements in the sequence
// replace two elements in the sequence
template < typename Key, typename Alloc, bool Gen >
INLINE void SequenceImplementation< Key, Alloc, Gen >::swap(Idx i, Idx j) {
if (i == j) return;
......@@ -959,7 +959,7 @@ namespace gum {
__v[i] = newKey;
}
// swap two elements in the sequence
// replace two elements in the sequence
template < typename Key, typename Alloc >
INLINE void SequenceImplementation< Key, Alloc, true >::swap(Idx i, Idx j) {
if (i == j) return;
......
......@@ -31,7 +31,7 @@ distribution.
* - fixed buggy compares operator==(), operator<(), and operator>()
* - fixed operator+=() to take a const ref argument, following spec.
* - added "copy" constructor with length, and most compare operators.
* - added swap(), clear(), size(), capacity(), operator+().
* - added replace(), clear(), size(), capacity(), operator+().
*/
#ifndef TIXML_USE_STL
......@@ -175,7 +175,7 @@ class TiXmlString {
void clear() {
// Lee:
// The original was just too strange, though correct:
// TiXmlString().swap(*this);
// TiXmlString().replace(*this);
// Instead use the quit & re-init:
quit();
init(0, 0);
......
......@@ -70,7 +70,7 @@ namespace gum {
Idx var3,
const std::vector< Idx >& conditioning_set,
double score) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
__scores.insert(std::tuple< IdSet<>, Idx, Idx, Idx >(
IdSet<>(conditioning_set, 0), var1, var2, var3),
std::move(score));
......@@ -83,7 +83,7 @@ namespace gum {
Idx var3,
IdSet< Alloc >& conditioning_set,
double score) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
__scores.insert(
std::tuple< IdSet<>, Idx, Idx, Idx >(conditioning_set, var1, var2, var3),
std::move(score));
......@@ -94,7 +94,7 @@ namespace gum {
Idx var2,
Idx var3,
const std::vector< Idx >& conditioning_set) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
__scores.erase(std::tuple< IdSet<>, Idx, Idx, Idx >(
IdSet<>(conditioning_set, 0), var1, var2, var3));
}
......@@ -105,7 +105,7 @@ namespace gum {
Idx var2,
Idx var3,
const IdSet< Alloc >& conditioning_set) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
__scores.erase(
std::tuple< IdSet<>, Idx, Idx, Idx >(conditioning_set, var1, var2, var3));
}
......@@ -115,7 +115,7 @@ namespace gum {
Idx var2,
Idx var3,
const std::vector< Idx >& conditioning_set) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
return __scores.exists(std::tuple< IdSet<>, Idx, Idx, Idx >(
IdSet<>(conditioning_set, 0), var1, var2, var3));
}
......@@ -123,7 +123,7 @@ namespace gum {
/// returns a given score
INLINE double Cache43ptInfo::score(
Idx var1, Idx var2, Idx var3, const std::vector< Idx >& conditioning_set) {
// if ( var1 > var2 ) std::swap( var1, var2 );
// if ( var1 > var2 ) std::replace( var1, var2 );
return __scores[std::tuple< IdSet<>, Idx, Idx, Idx >(
IdSet<>(conditioning_set, 0), var1, var2, var3)];
}
......
......@@ -98,20 +98,20 @@ namespace gum {
// @todo : optimisation with a always up-to-date value associated to each
// instantiation
virtual void changeNotification(gum::Instantiation&,
virtual void changeNotification(const gum::Instantiation&,
const gum::DiscreteVariable* const,
gum::Idx,
gum::Idx) override{};
virtual void setFirstNotification(gum::Instantiation&) override{};
virtual void setFirstNotification(const gum::Instantiation&) override{};
virtual void setLastNotification(gum::Instantiation&) override{};
virtual void setLastNotification(const gum::Instantiation&) override{};
virtual void setIncNotification(gum::Instantiation&) override{};
virtual void setIncNotification(const gum::Instantiation&) override{};
virtual void setDecNotification(gum::Instantiation&) override{};
virtual void setDecNotification(const gum::Instantiation&) override{};
virtual void setChangeNotification(gum::Instantiation&) override{};
virtual void setChangeNotification(const gum::Instantiation&) override{};
const std::string toString(const gum::Instantiation* i) const override {
return i->toString();
......@@ -172,8 +172,8 @@ namespace gum {
mutable HashTable< const DiscreteVariable*, GUM_SCALAR > __causal_weights;
/// @}
virtual void _swap(const DiscreteVariable* x,
const DiscreteVariable* y) override;
virtual void _replace(const DiscreteVariable* x,
const DiscreteVariable* y) override;
};
......
......@@ -55,7 +55,7 @@ namespace gum {
__causal_weights = from.__causal_weights;
}
// Copy constructor using a bijection to swap variables from source.
// Copy constructor using a bijection to replace variables from source.
template < typename GUM_SCALAR >
INLINE MultiDimICIModel< GUM_SCALAR >::MultiDimICIModel(
const Bijection< const DiscreteVariable*, const DiscreteVariable* >& bij,
......@@ -157,9 +157,9 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimICIModel< GUM_SCALAR >::_swap(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimReadOnly< GUM_SCALAR >::_swap(x, y);
INLINE void MultiDimICIModel< GUM_SCALAR >::_replace(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimReadOnly< GUM_SCALAR >::_replace(x, y);
__causal_weights.insert(y, __causal_weights[x]);
__causal_weights.erase(x);
}
......
......@@ -44,7 +44,7 @@ namespace gum {
GUM_CONS_CPY(MultiDimLogit);
}
// Copy constructor using a bijection to swap variables from source.
// Copy constructor using a bijection to replace variables from source.
template < typename GUM_SCALAR >
INLINE MultiDimLogit< GUM_SCALAR >::MultiDimLogit(
const Bijection< const DiscreteVariable*, const DiscreteVariable* >& bij,
......
......@@ -50,7 +50,7 @@ namespace gum {
GUM_CONS_CPY(MultiDimNoisyAND);
}
// Copy constructor using a bijection to swap variables from source.
// Copy constructor using a bijection to replace variables from source.
template < typename GUM_SCALAR >
INLINE MultiDimNoisyAND< GUM_SCALAR >::MultiDimNoisyAND(
const Bijection< const DiscreteVariable*, const DiscreteVariable* >& bij,
......
......@@ -45,7 +45,7 @@ namespace gum {
GUM_CONS_CPY(MultiDimNoisyORNet);
}
// Copy constructor using a bijection to swap variables from source.
// Copy constructor using a bijection to replace variables from source.
template < typename GUM_SCALAR >
INLINE MultiDimNoisyORNet< GUM_SCALAR >::MultiDimNoisyORNet(
const Bijection< const DiscreteVariable*, const DiscreteVariable* >& bij,
......
......@@ -112,20 +112,20 @@ namespace gum {
virtual std::string aggregatorName() const = 0;
const std::string toString() const override;
void changeNotification(gum::Instantiation&,
const gum::DiscreteVariable* const,
gum::Idx,
gum::Idx) override{};
void changeNotification(const gum::Instantiation&,
const gum::DiscreteVariable* const,
gum::Idx,
gum::Idx) override{};
void setFirstNotification(gum::Instantiation&) override{};
void setFirstNotification(const gum::Instantiation&) override{};
void setLastNotification(gum::Instantiation&) override{};
void setLastNotification(const gum::Instantiation&) override{};
void setIncNotification(gum::Instantiation&) override{};
void setIncNotification(const gum::Instantiation&) override{};
void setDecNotification(gum::Instantiation&) override{};
void setDecNotification(const gum::Instantiation&) override{};
void setChangeNotification(gum::Instantiation&) override{};
void setChangeNotification(const gum::Instantiation&) override{};
const std::string toString(const gum::Instantiation* i) const override {
return i->toString();
......@@ -136,7 +136,7 @@ namespace gum {
*
* This function is used for compute @see compressionRatio()
*/
Size realSize() const override { return 0; };
Size realSize() const override { return 0; };
/**
* @brief Returns the real name of the multiDimArray.
......@@ -149,7 +149,7 @@ namespace gum {
* determine which is the best functions to use, say, when we wish to use
* operators such as operator+ on two MultiDimImplementations.
*/
const std::string& name() const override;
const std::string& name() const override;
/**
* @brief Copy of a multiDimICIModel.
......@@ -160,8 +160,7 @@ namespace gum {
* @throw OperationNotAllowed Raised if src does not have the same domain
* size than this MultiDimContainer.
**/
void
copyFrom(const MultiDimContainer< GUM_SCALAR >& src) const override;
void copyFrom(const MultiDimContainer< GUM_SCALAR >& src) const override;
/// @}
protected:
......
......@@ -123,7 +123,7 @@ namespace gum {
* @param oldval The old value.
* @param newval The changed value.
*/
virtual void changeNotification(Instantiation& i,
virtual void changeNotification(const Instantiation& i,
const DiscreteVariable* const var,
Idx oldval,
Idx newval) = 0;
......@@ -132,31 +132,31 @@ namespace gum {
* @brief Listen to setFirst in a given Instantiation.
* @param i The Instantiation to listen.
*/
virtual void setFirstNotification(Instantiation& i) = 0;
virtual void setFirstNotification(const Instantiation& i) = 0;
/**
* @brief Listen to setLast in a given Instantiation.
* @param i The Instantiation to listen.
*/
virtual void setLastNotification(Instantiation& i) = 0;
virtual void setLastNotification(const Instantiation& i) = 0;
/**
* @brief Listen to increment in a given Instantiation.
* @param i The Instantiation to listen.
*/
virtual void setIncNotification(Instantiation& i) = 0;
virtual void setIncNotification(const Instantiation& i) = 0;
/**
* @brief Listen to increment in each recorded Instantiation.
* @param i The Instantiation to listen.
*/
virtual void setDecNotification(Instantiation& i) = 0;
virtual void setDecNotification(const Instantiation& i) = 0;
/**
* @brief Listen to an assignment of a value in a Instantiation.
* @param i The Instantiation to listen.
*/
virtual void setChangeNotification(Instantiation& i) = 0;
virtual void setChangeNotification(const Instantiation& i) = 0;
/**
* @brief Return a string representation of internal data about i in this.
......
......@@ -245,7 +245,7 @@ namespace gum {
virtual GUM_SCALAR& _get(const Instantiation& i) const;
virtual void _swap(const DiscreteVariable* x, const DiscreteVariable* y);
virtual void _replace(const DiscreteVariable* x, const DiscreteVariable* y);
};
......
......@@ -219,8 +219,8 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimArray< GUM_SCALAR >::_swap(const DiscreteVariable* x,
INLINE void MultiDimArray< GUM_SCALAR >::_replace(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimImplementation< GUM_SCALAR >::_swap(x, y);
MultiDimImplementation< GUM_SCALAR >::_replace(x, y);
}
} /* namespace gum */
......@@ -173,7 +173,7 @@ namespace gum {
virtual void _commitMultipleChanges();
virtual void _swap(const DiscreteVariable* x, const DiscreteVariable* y);
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y);
private:
/// The true data.
......
......@@ -150,9 +150,9 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimBijArray< GUM_SCALAR >::_swap(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimImplementation< GUM_SCALAR >::_swap(x, y);
INLINE void MultiDimBijArray< GUM_SCALAR >::_replace(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimImplementation< GUM_SCALAR >::_replace(x, y);
}
} // namespace gum
......@@ -229,20 +229,20 @@ namespace gum {
virtual GUM_SCALAR get(const Instantiation& i) const override;
virtual void changeNotification(Instantiation& i,
virtual void changeNotification(const Instantiation& i,
const DiscreteVariable* const var,
Idx oldval,
Idx newval) override;
virtual void setFirstNotification(Instantiation& i) override;
virtual void setFirstNotification(const Instantiation& i) override;
virtual void setLastNotification(Instantiation& i) override;
virtual void setLastNotification(const Instantiation& i) override;
virtual void setIncNotification(Instantiation& i) override;
virtual void setIncNotification(const Instantiation& i) override;
virtual void setDecNotification(Instantiation& i) override;
virtual void setDecNotification(const Instantiation& i) override;
virtual void setChangeNotification(Instantiation& i) override;
virtual void setChangeNotification(const Instantiation& i) override;
virtual bool registerSlave(Instantiation& i) override;
......@@ -272,8 +272,8 @@ namespace gum {
*/
virtual GUM_SCALAR& _get(const Instantiation& i) const override;
virtual void _swap(const DiscreteVariable* x,
const DiscreteVariable* y) override;
virtual void _replace(const DiscreteVariable* x,
const DiscreteVariable* y) override;
private:
/// The number of element allowed in __bucket.
......
......@@ -251,11 +251,17 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void MultiDimBucket< GUM_SCALAR >::changeNotification(
Instantiation& i, const DiscreteVariable* const var, Idx oldval, Idx newval) {
const Instantiation& i,
const DiscreteVariable* const var,
Idx oldval,
Idx newval) {
if (__bucket) {
try {
__bucket->changeNotification(
*(__instantiations).second(&i), var, oldval, newval);
*(__instantiations).second(const_cast< Instantiation* >(&i)),
var,
oldval,
newval);
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -266,10 +272,11 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimBucket< GUM_SCALAR >::setFirstNotification(Instantiation& i) {
MultiDimBucket< GUM_SCALAR >::setFirstNotification(const Instantiation& i) {
if (__bucket) {
try {
__bucket->setFirstNotification(*(__instantiations).second(&i));
__bucket->setFirstNotification(
*(__instantiations).second(const_cast< Instantiation* >(&i)));
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -279,10 +286,12 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimBucket< GUM_SCALAR >::setLastNotification(Instantiation& i) {
INLINE void
MultiDimBucket< GUM_SCALAR >::setLastNotification(const Instantiation& i) {
if (__bucket) {
try {
__bucket->setLastNotification(*(__instantiations).second(&i));
__bucket->setLastNotification(
*(__instantiations).second(const_cast< Instantiation* >(&i)));
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -292,10 +301,12 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimBucket< GUM_SCALAR >::setIncNotification(Instantiation& i) {
INLINE void
MultiDimBucket< GUM_SCALAR >::setIncNotification(const Instantiation& i) {
if (__bucket) {
try {
__bucket->setIncNotification(*(__instantiations.second(&i)));
__bucket->setIncNotification(
*(__instantiations.second(const_cast< Instantiation* >(&i))));
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -305,10 +316,12 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimBucket< GUM_SCALAR >::setDecNotification(Instantiation& i) {
INLINE void
MultiDimBucket< GUM_SCALAR >::setDecNotification(const Instantiation& i) {
if (__bucket) {
try {
__bucket->setDecNotification(*(__instantiations.second(&i)));
__bucket->setDecNotification(
*(__instantiations.second(const_cast< Instantiation* >(&i))));
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -319,10 +332,11 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimBucket< GUM_SCALAR >::setChangeNotification(Instantiation& i) {
MultiDimBucket< GUM_SCALAR >::setChangeNotification(const Instantiation& i) {
if (__bucket) {
try {
__bucket->setChangeNotification(*(__instantiations.second(&i)));
__bucket->setChangeNotification(
*(__instantiations.second(const_cast< Instantiation* >(&i))));
} catch (NotFound&) {
// Then i is not a slave of this
}
......@@ -559,23 +573,23 @@ namespace gum {
}
template < typename GUM_SCALAR >
INLINE void MultiDimBucket< GUM_SCALAR >::_swap(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimImplementation< GUM_SCALAR >::_swap(x, y);
INLINE void MultiDimBucket< GUM_SCALAR >::_replace(const DiscreteVariable* x,
const DiscreteVariable* y) {
MultiDimImplementation< GUM_SCALAR >::_replace(x, y);
typedef Bijection< Instantiation*, Instantiation* >::iterator_safe Iter;
for (Iter iter = __instantiations.beginSafe();
iter != __instantiations.endSafe();
++iter) {
iter.first()->swap(*x, *y);
iter.second()->swap(*x, *y);
iter.first()->replace(*x, *y);
iter.second()->replace(*x, *y);
}
if (__bucket) __bucket->swap(*x, *y);
if (__bucket) __bucket->replace(*x, *y);
__allVariables.erase(x);
__allVariables.insert(y);
__allVarsInst.swap(*x, *y);
__allVarsInst.replace(*x, *y);
}
template < typename GUM_SCALAR >
......
......@@ -128,20 +128,20 @@ namespace gum {
virtual bool registerSlave(Instantiation& i) final;
virtual void changeNotification(Instantiation& i,
virtual void changeNotification(const Instantiation& i,
const DiscreteVariable* const var,
Idx oldval,
Idx newval) final;
virtual void setChangeNotification(Instantiation& i) final;
virtual void setChangeNotification(const Instantiation& i) final;
virtual void setFirstNotification(Instantiation& i) final;
virtual void setFirstNotification(const Instantiation& i) final;
virtual void setLastNotification(Instantiation& i) final;
virtual void setLastNotification(const Instantiation& i) final;
virtual void setIncNotification(Instantiation& i) final;
virtual void setIncNotification(const Instantiation& i) final;
virtual void setDecNotification(Instantiation& i) final;
virtual void setDecNotification(const Instantiation& i) final;
virtual void notifyChange() const final;
......@@ -233,6 +233,8 @@ namespace gum {
/// @}
protected:
virtual void _replace(const DiscreteVariable* x, const DiscreteVariable* y);
/**
* protecte method to swap the implementation behind the Potential
* @warning unsafe method for slave Instantiations !
......
......@@ -180,7 +180,10 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void MultiDimDecorator< GUM_SCALAR >::changeNotification(
Instantiation& i, const DiscreteVariable* const var, Idx oldval, Idx newval) {
const Instantiation& i,
const DiscreteVariable* const var,
Idx oldval,
Idx newval) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)->changeNotification(
i, var, oldval, newval);
}
......@@ -189,7 +192,7 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::setChangeNotification(Instantiation& i) {
MultiDimDecorator< GUM_SCALAR >::setChangeNotification(const Instantiation& i) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)
->setChangeNotification(i);
}
......@@ -198,7 +201,7 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::setFirstNotification(Instantiation& i) {
MultiDimDecorator< GUM_SCALAR >::setFirstNotification(const Instantiation& i) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)
->setFirstNotification(i);
}
......@@ -207,7 +210,7 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::setLastNotification(Instantiation& i) {
MultiDimDecorator< GUM_SCALAR >::setLastNotification(const Instantiation& i) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)->setLastNotification(
i);
}
......@@ -216,7 +219,7 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::setIncNotification(Instantiation& i) {
MultiDimDecorator< GUM_SCALAR >::setIncNotification(const Instantiation& i) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)->setIncNotification(
i);
}
......@@ -225,7 +228,7 @@ namespace gum {
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::setDecNotification(Instantiation& i) {
MultiDimDecorator< GUM_SCALAR >::setDecNotification(const Instantiation& i) {
static_cast< MultiDimContainer< GUM_SCALAR >* >(_content)->setDecNotification(
i);
}
......@@ -401,6 +404,14 @@ namespace gum {
return _content->toString(i);
}
template < typename GUM_SCALAR >
INLINE void
MultiDimDecorator< GUM_SCALAR >::_replace(const DiscreteVariable* x,
const DiscreteVariable* y) {
this->content()->replace(*x, *y);