From 797d521bfd65830ce317a3a213998e4c3f0e53a3 Mon Sep 17 00:00:00 2001 From: Joris Mooij Date: Tue, 27 Oct 2009 17:04:31 +0100 Subject: [PATCH] Fixed const qualifiers in VarSet --- include/dai/varset.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/dai/varset.h b/include/dai/varset.h index 4f62a87..778a99f 100644 --- a/include/dai/varset.h +++ b/include/dai/varset.h @@ -74,7 +74,7 @@ class VarSet : public SmallSet { * number of possible values ("states") of variable \f$x_l\f$, the number of * joint configurations of the variables in \f$\{x_l\}_{l\in L}\f$ is given by \f$\prod_{l\in L} S_l\f$. */ - size_t nrStates() { + size_t nrStates() const { size_t states = 1; for( VarSet::const_iterator n = begin(); n != end(); n++ ) states *= n->states(); @@ -106,7 +106,7 @@ class VarSet : public SmallSet { * maps a joint state to a linear index; this is the inverse of the mapping * \f$\sigma^{-1}\f$ induced by calcStates(). */ - size_t calcState( const std::map &states ) { + size_t calcState( const std::map &states ) const { size_t prod = 1; size_t state = 0; for( VarSet::const_iterator n = begin(); n != end(); n++ ) { @@ -137,7 +137,7 @@ class VarSet : public SmallSet { * maps a linear index to a joint state; this is the inverse of the mapping \f$\sigma\f$ * induced by calcState(). */ - std::map calcStates( size_t linearState ) { + std::map calcStates( size_t linearState ) const { std::map states; for( VarSet::const_iterator n = begin(); n != end(); n++ ) { states[*n] = linearState % n->states(); -- 2.20.1