diff options
Diffstat (limited to 'impl/VariableAssignment.hpp')
-rw-r--r-- | impl/VariableAssignment.hpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/impl/VariableAssignment.hpp b/impl/VariableAssignment.hpp index cfce925..3f4ff70 100644 --- a/impl/VariableAssignment.hpp +++ b/impl/VariableAssignment.hpp @@ -22,8 +22,7 @@ template<typename Domain> struct DynamicVariableAssignment : public VariableAssignment<Domain> { DynamicVariableAssignment( const EquationSystem<Domain>& system, - DynamicMaxStrategy<Domain>& strat, - const Domain& value=infinity<Domain>() + DynamicMaxStrategy<Domain>& strat ) : _system(system), _strategy(strat), _values(system.variableCount(), unknown(infinity<Domain>())), @@ -46,7 +45,8 @@ struct DynamicVariableAssignment : public VariableAssignment<Domain> { } const Domain& operator[](const Variable<Domain>& var) const { - return _values[var]; + // slightly hacky + return const_cast<DynamicVariableAssignment<Domain>&>(*this)[var]; } const Domain& operator[](const Variable<Domain>& var) { @@ -60,7 +60,7 @@ struct DynamicVariableAssignment : public VariableAssignment<Domain> { if (_stable.contains(x)) { _stable.remove(x); _values[x] = unknown(infinity<Domain>()); - + solve(x); /* IdSet<Variable<Domain> > infl = _influence[x]; @@ -128,12 +128,11 @@ private: }; const EquationSystem<Domain>& _system; - const DynamicMaxStrategy<Domain>& _strategy; - mutable IdMap<Variable<Domain>, Domain> _values; -public: - mutable IdSet<Variable<Domain> > _stable; -private: - mutable IdMap<Variable<Domain>,IdSet<Variable<Domain> > > _influence; + DynamicMaxStrategy<Domain>& _strategy; + IdMap<Variable<Domain>, Domain> _values; + IdSet<Variable<Domain> > _stable; + IdMap<Variable<Domain>,IdSet<Variable<Domain> > > _influence; + bool _frozen; }; #endif |