From bfc9c91539264c4ae8accc125883c47fce3b5f41 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 30 Jun 2022 21:19:36 +0200 Subject: [PATCH] Improved iteration. --- libsolutil/LP.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index ed489bcc6..d0cf68b6f 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -582,10 +582,10 @@ void LPSolver::SubProblem::update(size_t _varIndex, RationalWithDelta const& _va { RationalWithDelta delta = _value - variables[_varIndex].value; variables[_varIndex].value = _value; - for (size_t j = 0; j < variables.size(); j++) - if (basicVariables.count(j) && factors[basicVariables.at(j)][_varIndex]) + for (auto&& [j, row]: basicVariables) + if (factors[row][_varIndex]) { - variables[j].value += delta * factors[basicVariables.at(j)][_varIndex]; + variables[j].value += delta * factors[row][_varIndex]; //variablesPotentiallyOutOfBounds.insert(j); }