From 4b345ff613a93fafe41830f3dd4b75b4fcebd3a7 Mon Sep 17 00:00:00 2001 From: Henri Lefebvre Date: Mon, 18 Dec 2023 12:52:06 +0100 Subject: [PATCH] fix Model::fix did not take into account quadratic terms --- lib/src/modeling/matrix/Row.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/modeling/matrix/Row.cpp b/lib/src/modeling/matrix/Row.cpp index 4b8c21fe..7436d04b 100644 --- a/lib/src/modeling/matrix/Row.cpp +++ b/lib/src/modeling/matrix/Row.cpp @@ -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;