From 12b86dc91316a5591c22160a9312e62c77a65b2f Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 17 May 2012 01:58:42 +1000 Subject: Fix a segfault and a stupid parser decision. --- impl/MaxStrategy.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'impl/MaxStrategy.hpp') 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 #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; } -- cgit v1.2.3