File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ def _set_objective(self, obj):
600600 if self ._last_results_object is not None :
601601 self ._last_results_object .solution_loader .invalidate ()
602602 n = len (self ._pyomo_var_to_solver_var_map )
603+ indices = np .arange (n )
603604 costs = np .zeros (n , dtype = np .double )
604605
605606 # Initialize empty lists for all coefficient types
@@ -658,6 +659,7 @@ def _set_objective(self, obj):
658659 )
659660
660661 self ._solver_model .changeObjectiveSense (sense )
662+ self ._solver_model .changeColsCost (n , indices , costs )
661663 self ._mutable_objective = _MutableObjective (
662664 self ._solver_model ,
663665 mutable_constant ,
Original file line number Diff line number Diff line change 99# This software is distributed under the 3-clause BSD License.
1010# ___________________________________________________________________________
1111
12- import subprocess
13- import sys
14-
1512import pyomo .common .unittest as unittest
1613import pyomo .environ as pe
1714
1815from pyomo .contrib .solver .solvers .highs import Highs
19- from pyomo .common .log import LoggingIntercept
20- from pyomo .common .tee import capture_output
2116
2217opt = Highs ()
2318if not opt .available ():
You can’t perform that action at this time.
0 commit comments