File tree 2 files changed +2
-5
lines changed
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):
600
600
if self ._last_results_object is not None :
601
601
self ._last_results_object .solution_loader .invalidate ()
602
602
n = len (self ._pyomo_var_to_solver_var_map )
603
+ indices = np .arange (n )
603
604
costs = np .zeros (n , dtype = np .double )
604
605
605
606
# Initialize empty lists for all coefficient types
@@ -658,6 +659,7 @@ def _set_objective(self, obj):
658
659
)
659
660
660
661
self ._solver_model .changeObjectiveSense (sense )
662
+ self ._solver_model .changeColsCost (n , indices , costs )
661
663
self ._mutable_objective = _MutableObjective (
662
664
self ._solver_model ,
663
665
mutable_constant ,
Original file line number Diff line number Diff line change 9
9
# This software is distributed under the 3-clause BSD License.
10
10
# ___________________________________________________________________________
11
11
12
- import subprocess
13
- import sys
14
-
15
12
import pyomo .common .unittest as unittest
16
13
import pyomo .environ as pe
17
14
18
15
from pyomo .contrib .solver .solvers .highs import Highs
19
- from pyomo .common .log import LoggingIntercept
20
- from pyomo .common .tee import capture_output
21
16
22
17
opt = Highs ()
23
18
if not opt .available ():
You can’t perform that action at this time.
0 commit comments