Allow updating external variables from the solver

This commit is contained in:
Chinmay Garde
2015-06-24 18:03:21 -07:00
parent d4a67499e9
commit 891085b74b

View File

@@ -140,7 +140,17 @@ class Solver {
return _dualOptimize();
}
void updateVariable() {}
void updateVariable() {
for (Variable variable in _vars.keys) {
Symbol symbol = _vars[variable];
Row row = _rows[symbol];
if (row == null) {
variable.value = 0.0;
} else {
variable.value = row.constant;
}
}
}
Solver operator <<(Constraint c) => this..addConstraint(c);