summaryrefslogtreecommitdiff
path: root/impl/EquationSystem.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/EquationSystem.hpp')
-rw-r--r--impl/EquationSystem.hpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/impl/EquationSystem.hpp b/impl/EquationSystem.hpp
index 4bae53a..4c55bd7 100644
--- a/impl/EquationSystem.hpp
+++ b/impl/EquationSystem.hpp
@@ -88,32 +88,6 @@ struct EquationSystem {
return _right_sides[var.id()];
}
- StableVariableAssignment<Domain>* assignment(const Domain& value) const {
- return new StableVariableAssignment<Domain>(_variables.size(), value);
- }
- StableVariableAssignment<Domain>* eval(const VariableAssignment<Domain>& rho) const {
- StableVariableAssignment<Domain>* result = this->assignment(-infinity<Domain>());
- for (unsigned int i = 0, length = _variables.size();
- i < length;
- ++i) {
- const Variable<Domain>& var = *_variables[i];
- const Expression<Domain>& expr = * (*this)[var];
- (*result)[var] = expr.eval(rho);
- }
- return result;
- }
- StableVariableAssignment<Domain>* eval(const VariableAssignment<Domain>& rho, const MaxStrategy<Domain>& strat) const {
- StableVariableAssignment<Domain>* result = this->assignment(-infinity<Domain>());
- for (unsigned int i = 0, length = _variables.size();
- i < length;
- ++i) {
- const Variable<Domain>& var = *_variables[i];
- const Expression<Domain>& expr = * (*this)[var];
- (*result)[var] = expr.eval(rho, strat);
- }
- return result;
- }
-
void indexMaxExpressions() {
_expr_to_var = new IdMap<MaxExpression<Domain>,Variable<Domain>*>(maxExpressionCount(), NULL);
for (unsigned int i = 0, length = _right_sides.size(); i < length; ++i) {
@@ -130,11 +104,7 @@ struct EquationSystem {
return NULL;
}
} else {
- for (unsigned int i = 0, length = _right_sides.size(); i < length; ++i) {
- if (_right_sides[i] == &expr)
- return _variables[i];
- }
- return NULL;
+ throw "Must index max expressions before attempting lookup";
}
}