From 0c7d0547fab5acd531f9d1dc80f08fd31de0ddf1 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Tue, 15 Oct 2024 16:01:32 +0200 Subject: [PATCH] Update src/solver/optimisation/LegacyFiller.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Florian Omnès --- src/solver/optimisation/LegacyFiller.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/solver/optimisation/LegacyFiller.cpp b/src/solver/optimisation/LegacyFiller.cpp index 0e491a8e9c..f2d3de0bdb 100644 --- a/src/solver/optimisation/LegacyFiller.cpp +++ b/src/solver/optimisation/LegacyFiller.cpp @@ -73,17 +73,17 @@ void LegacyFiller::CopyVariables(ILinearProblem& pb) const void LegacyFiller::UpdateContraints(unsigned idxRow, ILinearProblem& pb) const { double bMin = -pb.infinity(), bMax = pb.infinity(); - if (problemeSimplexe_->Sens[idxRow] == '=') + switch (problemeSimplexe_->Sens[idxRow]) { + case '=': bMin = bMax = problemeSimplexe_->SecondMembre[idxRow]; - } - else if (problemeSimplexe_->Sens[idxRow] == '<') - { + break; + case '<': bMax = problemeSimplexe_->SecondMembre[idxRow]; - } - else if (problemeSimplexe_->Sens[idxRow] == '>') - { + break; + case: '>': bMin = problemeSimplexe_->SecondMembre[idxRow]; + break; } pb.addConstraint(bMin, bMax, constraintNameManager_.GetName(idxRow));