File tree 1 file changed +2
-2
lines changed
pyomo/solvers/plugins/solvers
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def __init__(
51
51
self .offset = offset or 0.0
52
52
self .q_variables1 = q_variables1 or []
53
53
self .q_variables2 = q_variables2 or []
54
- self .q_coefficients = q_coefficients or []
54
+ self .q_coefficients = [ float ( coef ) for coef in q_coefficients or [] ]
55
55
56
56
57
57
def _is_numeric (x ):
@@ -573,7 +573,7 @@ def _set_objective(self, obj):
573
573
self ._solver_model .objective .set_linear (list (zip (cplex_expr .variables , cplex_expr .coefficients )))
574
574
575
575
if quadratic_objective_already_exists or contains_quadratic_terms :
576
- self ._solver_model .objective .set_quadratic ([0 ] * num_cols )
576
+ self ._solver_model .objective .set_quadratic ([0.0 ] * num_cols )
577
577
578
578
if contains_quadratic_terms :
579
579
self ._solver_model .objective .set_quadratic_coefficients (
You can’t perform that action at this time.
0 commit comments