Skip to content

Commit eeccd9d

Browse files
committed
changed: getinfo dictionnary value type is now Any
the `Union` type was overly complex and `getinfo` should not be used in "normal" operation, only for troubleshoothing. The computational performance are not that important (there is already many allocations in this function)
1 parent 3ed42e4 commit eeccd9d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/controller/execute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ julia> round.(getinfo(mpc)[:Ŷ], digits=3)
114114
function getinfo(mpc::PredictiveController{NT}) where NT<:Real
115115
model = mpc.estim.model
116116
nŶe, nUe = (mpc.Hp+1)*model.ny, (mpc.Hp+1)*model.nu
117-
info = Dict{Symbol, Union{JuMP._SolutionSummary, Vector{NT}, NT}}()
117+
info = Dict{Symbol, Any}()
118118
Ŷ0, u0, û0 = similar(mpc.Yop), similar(model.uop), similar(model.uop)
119119
Ŷs = similar(mpc.Yop)
120120
x̂0, x̂0next = similar(mpc.estim.x̂0), similar(mpc.estim.x̂0)

src/estimator/mhe/execute.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ function getinfo(estim::MovingHorizonEstimator{NT}) where NT<:Real
108108
nu, ny, nd = model.nu, model.ny, model.nd
109109
nx̂, nym, nŵ, nϵ = estim.nx̂, estim.nym, estim.nx̂, estim.
110110
nx̃ =+ nx̂
111-
MyTypes = Union{JuMP._SolutionSummary, Hermitian{NT, Matrix{NT}}, Vector{NT}, NT}
112-
info = Dict{Symbol, MyTypes}()
111+
info = Dict{Symbol, Any}()
113112
V̂, X̂0 = similar(estim.Y0m[1:nym*Nk]), similar(estim.X̂0[1:nx̂*Nk])
114113
û0, ŷ0 = similar(model.uop), similar(model.yop)
115114
V̂, X̂0 = predict!(V̂, X̂0, û0, ŷ0, estim, model, estim.Z̃)

0 commit comments

Comments
 (0)