From a1b28d756fe52a53d9d4da4d23853969fd529115 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 23 Oct 2012 14:40:38 +1100 Subject: Make the recursive solver work properly. If you ignore the intermediate results for the strategy iteration phase then you're in the clear! I think! --- impl/VariableAssignment.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'impl/VariableAssignment.hpp') diff --git a/impl/VariableAssignment.hpp b/impl/VariableAssignment.hpp index ae5efd7..a1f0b5b 100644 --- a/impl/VariableAssignment.hpp +++ b/impl/VariableAssignment.hpp @@ -22,7 +22,7 @@ struct DynamicVariableAssignment : public VariableAssignment { const DynamicMaxStrategy& strat ) : _system(system), _strategy(strat), - _values(system.variableCount(), infinity()), + _values(system.variableCount(), unknown(infinity())), _stable(system.variableCount()), _influence(system.variableCount(), IdSet >(system.variableCount())) @@ -37,9 +37,20 @@ struct DynamicVariableAssignment : public VariableAssignment { log::fixpoint << indent() << "Invalidating " << x << std::endl; if (_stable.contains(x)) { _stable.remove(x); - _values[x] = infinity(); + _values[x] = unknown(infinity()); solve(x); + /* + IdSet > infl = _influence[x]; + _influence[x].clear(); + for (typename IdSet >::iterator + it = infl.begin(), + ei = infl.end(); + it != ei; + ++it) { + invalidate(_system.variable(*it)); + } + */ } } @@ -97,7 +108,9 @@ private: const EquationSystem& _system; const DynamicMaxStrategy& _strategy; mutable IdMap, Domain> _values; +public: mutable IdSet > _stable; +private: mutable IdMap,IdSet > > _influence; }; -- cgit v1.2.3