@@ -53,14 +53,13 @@ struct ControllerWeights{
5353 iszero_E:: Bool
5454 isinf_C :: Bool
5555 function ControllerWeights{NT}(
56- model, Hp, Hc, M_Hp:: MW , N_Hc:: NW , L_Hp:: LW , Cwt= Inf , Ewt= 0
56+ M_Hp:: MW , N_Hc:: NW , L_Hp:: LW , Cwt, Ewt
5757 ) where {
5858 NT<: Real ,
5959 MW<: AbstractMatrix{NT} ,
6060 NW<: AbstractMatrix{NT} ,
6161 LW<: AbstractMatrix{NT}
6262 }
63- validate_weights(model, Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt, Ewt)
6463 nΔU = size(N_Hc, 1 )
6564 C = Cwt
6665 isinf_C = isinf(C)
@@ -87,11 +86,12 @@ struct ControllerWeights{
8786 end
8887end
8988
90- " Outer constructor to convert weight matrix number type to `NT` if necessary."
89+ " Outer constructor to validate and convert weight matrices if necessary."
9190function ControllerWeights(
9291 model:: SimModel{NT} , Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt= Inf , Ewt= 0
9392 ) where {NT<: Real }
94- return ControllerWeights{NT}(model, Hp, Hc, NT.(M_Hp), NT.(N_Hc), NT.(L_Hp), Cwt, Ewt)
93+ validate_weights(model, Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt, Ewt)
94+ return ControllerWeights{NT}(NT.(M_Hp), NT.(N_Hc), NT.(L_Hp), Cwt, Ewt)
9595end
9696
9797" Include all the data for the constraints of [`PredictiveController`](@ref)"
0 commit comments