Skip to content

Commit 59cd010

Browse files
committed
Merge branch 'master' of github.com:joehuchette/PiecewiseLinearOpt.jl
2 parents 39e8f2f + 2f0b4f2 commit 59cd010

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/jump.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function piecewiselinear(m::JuMP.Model, x::JuMP.Variable, pwl::UnivariatePWLFunc
7373
elseif method == :SymmetricCelaya
7474
sos2_symmetric_celaya_formulation!(m, λ)
7575
elseif method == :SOS2
76-
JuMP.addSOS2(m, [λ[i] for i in 1:n])
76+
JuMP.addSOS2(m, [i*λ[i] for i in 1:n])
7777
else
7878
error("Unrecognized method $method")
7979
end
@@ -490,8 +490,8 @@ function piecewiselinear(m::JuMP.Model, x₁::JuMP.Variable, x₂::JuMP.Variable
490490
γʸ = JuMP.@variable(m, [1:nʸ], lowerbound=0, upperbound=1, basename="γʸ_$counter")
491491
JuMP.@constraint(m, [tˣ in 1:nˣ], γˣ[tˣ] == sum(λ[tˣ,tʸ] forin 1:nʸ))
492492
JuMP.@constraint(m, [tʸ in 1:nʸ], γʸ[tʸ] == sum(λ[tˣ,tʸ] forin 1:nˣ))
493-
JuMP.addSOS2(m, γˣ)
494-
JuMP.addSOS2(m, γʸ)
493+
JuMP.addSOS2(m, [i*γˣ[i] for i in 1:nˣ])
494+
JuMP.addSOS2(m, [i*γʸ[i] for i in 1:nʸ])
495495
else
496496
error("Unrecognized method $method")
497497
end

0 commit comments

Comments
 (0)