diff options
author | Carlo Zancanaro <carlo@carlo-laptop> | 2012-10-23 14:40:38 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@carlo-laptop> | 2012-10-23 14:40:38 +1100 |
commit | a1b28d756fe52a53d9d4da4d23853969fd529115 (patch) | |
tree | e599c1d3820ab9613af6ab129843f4a2132e5dbc /impl/Expression.hpp | |
parent | 697c1c0cd3815eee72b3eedb874fe0e044a69432 (diff) |
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!
Diffstat (limited to 'impl/Expression.hpp')
-rw-r--r-- | impl/Expression.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/impl/Expression.hpp b/impl/Expression.hpp index 00bc9cd..0f3717f 100644 --- a/impl/Expression.hpp +++ b/impl/Expression.hpp @@ -143,7 +143,7 @@ struct OperatorExpression : public Expression<Domain> { template<typename Domain> struct MaxExpression : public OperatorExpression<Domain> { MaxExpression(const unsigned int& id, const Maximum<Domain>& op, const std::vector<Expression<Domain>*>& arguments) - : OperatorExpression<Domain>(op, arguments), _id(id) { } + : OperatorExpression<Domain>(op, arguments), _id(id) {} const MaxExpression* toMaxExpression() const { return this; @@ -161,9 +161,11 @@ struct MaxExpression : public OperatorExpression<Domain> { i < length; ++i) { const Domain value = this->_arguments[i]->eval(rho, strat); - if (bestValue < value) { - bestValue = value; - bestIndex = i; + if (!value.isUnknown()) { + if (bestValue < value) { + bestValue = value; + bestIndex = i; + } } } return bestIndex; |