From c065ae2bd1176b17d137e0f52df6ef1d9af9e757 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 26 Oct 2012 16:29:52 +1100 Subject: Try to make the correct solver into a local solver As far as I can tell, it's worked! Hooray! --- impl/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'impl/main.cpp') diff --git a/impl/main.cpp b/impl/main.cpp index 84f17dd..94351ec 100644 --- a/impl/main.cpp +++ b/impl/main.cpp @@ -140,19 +140,20 @@ int main (int argc, char* argv[]) { log::debug << system << endl; system.indexMaxExpressions(); // make reverse-lookup O(1) instead of O(n) - IdMap,ZBar> result = solve_for(system); + Solver solver(system); // local *and* lazy. I love it! if (variables.size() > 0) { for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) { Variable& var = system.variable(i); if (variables.find(var.name()) != variables.end()) - cout << var.name() << " = " << result[var] << endl; + cout << var.name() << " = " << solver.solve(var) << endl; } } else { for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) { Variable& var = system.variable(i); - cout << var.name() << " = " << result[var] << endl; + cout << var.name() << " = " << solver.solve(var) << endl; } } + /* DynamicMaxStrategy strategy(system); DynamicVariableAssignment rho(system, strategy); -- cgit v1.2.3