From 55693c2067b60819ff16edab78fdab62713f74bc Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Mon, 27 May 2024 19:50:34 +1000 Subject: [PATCH] Multi-obj: Copt #239 --- solvers/copt/coptmodelapi.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solvers/copt/coptmodelapi.cc b/solvers/copt/coptmodelapi.cc index 12919b834..50849e825 100644 --- a/solvers/copt/coptmodelapi.cc +++ b/solvers/copt/coptmodelapi.cc @@ -17,6 +17,9 @@ void CoptModelAPI::SetLinearObjective( int iobj, const LinearObjective& lo ) { if (iobj<1) { COPT_CCALL(COPT_SetObjSense(lp(), obj::Type::MAX==lo.obj_sense() ? COPT_MAXIMIZE : COPT_MINIMIZE) ); + double zero_out = 0.0; + for (int i=NumVars(); i--; ) + COPT_CCALL(COPT_SetColObj(lp(), 1, &i, &zero_out)); COPT_CCALL(COPT_SetColObj(lp(), lo.num_terms(), lo.vars().data(), lo.coefs().data()) ); } else {