summaryrefslogtreecommitdiff
path: root/impl/MaxStrategy.hpp
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@carlo-laptop>2012-05-17 01:58:42 +1000
committerCarlo Zancanaro <carlo@carlo-laptop>2012-05-17 01:58:42 +1000
commit12b86dc91316a5591c22160a9312e62c77a65b2f (patch)
treec1689f6d50fc529d9b0dcd38a021a15109c5867d /impl/MaxStrategy.hpp
parentfcecd0e7dc0bf103986c02e2f29fb518cd5571c5 (diff)
Fix a segfault and a stupid parser decision.
Diffstat (limited to 'impl/MaxStrategy.hpp')
-rw-r--r--impl/MaxStrategy.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/impl/MaxStrategy.hpp b/impl/MaxStrategy.hpp
index e52fd99..f4e4055 100644
--- a/impl/MaxStrategy.hpp
+++ b/impl/MaxStrategy.hpp
@@ -1,6 +1,7 @@
#ifndef MAX_STRATEGY_HPP
#define MAX_STRATEGY_HPP
+#include <iostream>
#include "Expression.hpp"
#include "EquationSystem.hpp"
#include "VariableAssignment.hpp"
@@ -69,7 +70,12 @@ struct MaxStrategy {
if (best.first > oldValue)
newStrategy[*expr] = best.second;
}
- std::cout << "Strat improvement: " << newStrategy[*s.getMax(0)] << std::endl;
+ std::cerr << "Strat improvement: ";
+ if (_length > 0)
+ std::cerr << newStrategy[*s.getMax(0)];
+ else
+ std::cerr << "no max expressions";
+ std::cerr << std::endl;
return newStrategy;
}