@@ -510,7 +510,9 @@ Objective function of [`MovingHorizonEstimator`](@ref) when `model` is a [`LinMo
510
510
It can be called on a [`MovingHorizonEstimator`](@ref) object to evaluate the objective
511
511
function at specific `Z̃` and `V̂` values.
512
512
"""
513
- function obj_nonlinprog! ( _ , estim:: MovingHorizonEstimator , :: LinModel , _ , Z̃)
513
+ function obj_nonlinprog! (
514
+ _ , estim:: MovingHorizonEstimator , :: LinModel , _ , Z̃:: AbstractVector{NT}
515
+ ) where NT<: Real
514
516
return obj_quadprog (Z̃, estim. H̃, estim. q̃) + estim. r[]
515
517
end
516
518
@@ -532,11 +534,6 @@ function obj_nonlinprog!(
532
534
x̂0arr, Ŵ, V̂ = @views Z̃[nx̃- nx̂+ 1 : nx̃], Z̃[nx̃+ 1 : nx̃+ nŴ], V̂[1 : nYm]
533
535
x̄ .= estim. x̂0arr_old .- x̂0arr
534
536
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̂))
540
537
return dot (x̄, invP̄, x̄) + dot (Ŵ, invQ̂_Nk, Ŵ) + dot (V̂, invR̂_Nk, V̂) + Jϵ
541
538
end
542
539
0 commit comments