diff options
Diffstat (limited to 'impl/EquationSystem.hpp')
-rw-r--r-- | impl/EquationSystem.hpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/impl/EquationSystem.hpp b/impl/EquationSystem.hpp index c0734aa..2fd24bd 100644 --- a/impl/EquationSystem.hpp +++ b/impl/EquationSystem.hpp @@ -96,17 +96,12 @@ struct EquationSystem { } Variable<Domain>* varFromExpr(const Expression<Domain>& expr) const { - if (_expr_to_var) { // we've indexed: - const MaxExpression<Domain>* maxExpr = dynamic_cast<const MaxExpression<Domain>*>(&expr); - if (maxExpr) { - return (*_expr_to_var)[*maxExpr]; - } else { - return NULL; - } + assert(_expr_to_var); // make sure we've indexed + const MaxExpression<Domain>* maxExpr = expr.toMaxExpression();//dynamic_cast<const MaxExpression<Domain>*>(&expr); + if (maxExpr) { + return (*_expr_to_var)[*maxExpr]; } else { - std::cout << "throw exception" << *(char*)NULL; return NULL; - //throw "Must index max expressions before attempting lookup"; } } |