@@ -302,7 +302,7 @@ function init_predmat(
302
302
G = Matrix {NT} (undef, Hp* ny, nd)
303
303
jx̂ = Matrix {NT} (undef, nx̂, Hp* nd)
304
304
J = repeatdiag (D̂d, Hp)
305
- if nd ≠ 0
305
+ if nd > 0
306
306
for j= 1 : Hp
307
307
iRow = (1 : ny) .+ ny* (j- 1 )
308
308
G[iRow,:] = Ĉ* getpower (Âpow, j- 1 )* B̂d
@@ -853,7 +853,7 @@ function linconstraint!(mpc::PredictiveController, model::LinModel, ::Transcript
853
853
fx̂ .= mpc. con. bx̂
854
854
mul! (fx̂, mpc. con. kx̂, mpc. estim. x̂0, 1 , 1 )
855
855
mul! (fx̂, mpc. con. vx̂, mpc. estim. lastu0, 1 , 1 )
856
- if model. nd ≠ 0
856
+ if model. nd > 0
857
857
mul! (fx̂, mpc. con. gx̂, mpc. d0, 1 , 1 )
858
858
mul! (fx̂, mpc. con. jx̂, mpc. D̂0, 1 , 1 )
859
859
end
@@ -939,7 +939,7 @@ function linconstrainteq!(mpc::PredictiveController, model::LinModel, ::Multiple
939
939
Fŝ .= mpc. con. Bŝ
940
940
mul! (Fŝ, mpc. con. Kŝ, mpc. estim. x̂0, 1 , 1 )
941
941
mul! (Fŝ, mpc. con. Vŝ, mpc. estim. lastu0, 1 , 1 )
942
- if model. nd ≠ 0
942
+ if model. nd > 0
943
943
mul! (Fŝ, mpc. con. Gŝ, mpc. d0, 1 , 1 )
944
944
mul! (Fŝ, mpc. con. Jŝ, mpc. D̂0, 1 , 1 )
945
945
end
0 commit comments