Skip to content

Commit

Permalink
fix Model::fix did not take into account quadratic terms
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Dec 18, 2023
1 parent 694cc7a commit 4b345ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/modeling/matrix/Row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ idol::Row idol::Row::fix(const Solution::Primal &t_primals) const {
result.linear() += constant.fix(t_primals) * var;
}

for (const auto& [var1, var2, constant] : quadratic()) {
result.quadratic() += constant.fix(t_primals) * var1 * var2;
}

result.rhs() = rhs().fix(t_primals);

return result;
Expand Down

0 comments on commit 4b345ff

Please sign in to comment.