Skip to content

Commit b87fd44

Browse files
committed
debug: also store C_wmin and C_wmax
1 parent d217df2 commit b87fd44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/controller/construct.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ struct ControllerConstraint{NT<:Real, GCfunc<:Union{Nothing, Function}}
182182
beq ::Vector{NT}
183183
# nonlinear equality constraints:
184184
neq ::Int
185-
# constraint softness parameter vectors for the nonlinear inequality constraints:
185+
# constraint softness parameter vectors needing seperate storage:
186186
C_ymin ::Vector{NT}
187187
C_ymax ::Vector{NT}
188+
C_wmin ::Vector{NT}
189+
C_wmax ::Vector{NT}
188190
c_x̂min ::Vector{NT}
189191
c_x̂max ::Vector{NT}
190192
# indices of finite numbers in the g vector (nonlinear inequality constraints):
@@ -478,11 +480,13 @@ function setconstraint!(
478480
if !isnothing(C_wmin)
479481
size(C_wmin) == (nw*(Hp+1),) || throw(ArgumentError("C_wmin size must be $((nw*(Hp+1),))"))
480482
any(<(0), C_wmin) && error("C_wmin weights should be non-negative")
483+
con.C_wmin .= C_wmin
481484
con.A_Wmin[:, end] .= -C_wmin
482485
end
483486
if !isnothing(C_wmax)
484487
size(C_wmax) == (nw*(Hp+1),) || throw(ArgumentError("C_wmax size must be $((nw*(Hp+1),))"))
485488
any(<(0), C_wmax) && error("C_wmax weights should be non-negative")
489+
con.C_wmax .= C_wmax
486490
con.A_Wmax[:, end] .= -C_wmax
487491
end
488492
if !isnothing(c_x̂min)
@@ -833,7 +837,7 @@ function init_defaultcon_mpc(
833837
A_ŝ ,
834838
Aeq , beq ,
835839
neq ,
836-
C_ymin , C_ymax , c_x̂min , c_x̂max ,
840+
C_ymin , C_ymax , C_wmin , C_wmax , c_x̂min , c_x̂max ,
837841
i_g ,
838842
gc! , nc
839843
)

0 commit comments

Comments
 (0)