From d130a97614173d5f623694d2e2f47f4d92f9e7a9 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Wed, 4 Jun 2025 18:00:08 +0200 Subject: [PATCH] Fixup --- ortools/linear_solver/xpress_interface.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ortools/linear_solver/xpress_interface.cc b/ortools/linear_solver/xpress_interface.cc index a5d13f9cea..9fb470a354 100644 --- a/ortools/linear_solver/xpress_interface.cc +++ b/ortools/linear_solver/xpress_interface.cc @@ -424,8 +424,11 @@ class XpressInterface : public MPSolverInterface { XPRSprob mLp; bool const mMip; - // Looping on MPConstraint::coefficients_ yields non-reproducible results since is uses pointer addresses as keys, the value of which is non-deterministic, especially their order. - std::map > > fixedOrderCoefficientsPerConstraint; + // Looping on MPConstraint::coefficients_ yields non-reproducible results + // since is uses pointer addresses as keys, the value of which is + // non-deterministic, especially their order. + std::map > > + fixedOrderCoefficientsPerConstraint; // Incremental extraction. // Without incremental extraction we have to re-extract the model every @@ -1091,7 +1094,8 @@ void XpressInterface::SetCoefficient(MPConstraint* const constraint, double new_value, double) { InvalidateSolutionSynchronization(); - fixedOrderCoefficientsPerConstraint[constraint->index()].push_back(std::make_pair(variable->index(), new_value)); + fixedOrderCoefficientsPerConstraint[constraint->index()].emplace_back( + variable->index(), new_value); // Changing a single coefficient in the matrix is potentially pretty // slow since that coefficient has to be found in the sparse matrix