@@ -510,7 +510,9 @@ Objective function of [`MovingHorizonEstimator`](@ref) when `model` is a [`LinMo
510510It can be called on a [`MovingHorizonEstimator`](@ref) object to evaluate the objective
511511function at specific `Z̃` and `V̂` values.
512512"""
513- function obj_nonlinprog! ( _ , estim:: MovingHorizonEstimator , :: LinModel , _ , Z̃)
513+ function obj_nonlinprog! (
514+ _ , estim:: MovingHorizonEstimator , :: LinModel , _ , Z̃:: AbstractVector{NT}
515+ ) where NT<: Real
514516 return obj_quadprog (Z̃, estim. H̃, estim. q̃) + estim. r[]
515517end
516518
@@ -532,11 +534,6 @@ function obj_nonlinprog!(
532534 x̂0arr, Ŵ, V̂ = @views Z̃[nx̃- nx̂+ 1 : nx̃], Z̃[nx̃+ 1 : nx̃+ nŴ], V̂[1 : nYm]
533535 x̄ .= estim. x̂0arr_old .- x̂0arr
534536 Jϵ = nϵ ≠ 0 ? estim. C* Z̃[begin ]^ 2 : zero (NT)
535- # println(x̂0arr)
536- # println(invP̄)
537- # println(dot(x̄, invP̄, x̄))
538- # println(dot(Ŵ, invQ̂_Nk, Ŵ))
539- # println(dot(V̂, invR̂_Nk, V̂))
540537 return dot (x̄, invP̄, x̄) + dot (Ŵ, invQ̂_Nk, Ŵ) + dot (V̂, invR̂_Nk, V̂) + Jϵ
541538end
542539
0 commit comments