@@ -1343,22 +1343,24 @@ function get_optim_functions(
13431343 end
13441344 Z̃ = Z̃cache
13451345 ϵ = (nϵ ≠ 0 ) ? Z̃[begin ] : zero (T) # ϵ = 0 if Cwt=Inf (meaning: no relaxation)
1346- V̂, X̂0 = get_tmp (V̂_cache, Z̃1 ), get_tmp (X̂0_cache, Z̃1 )
1347- û0, ŷ0 = get_tmp (û0_cache, Z̃1 ), get_tmp (ŷ0_cache, Z̃1 )
1348- g = get_tmp (g_cache, Z̃1 )
1346+ V̂, X̂0 = get_tmp (V̂_cache, T ), get_tmp (X̂0_cache, T )
1347+ û0, ŷ0 = get_tmp (û0_cache, T ), get_tmp (ŷ0_cache, T )
1348+ g = get_tmp (g_cache, T )
13491349 V̂, X̂0 = predict! (V̂, X̂0, û0, ŷ0, estim, model, Z̃)
13501350 g = con_nonlinprog! (g, estim, model, X̂0, V̂, ϵ)
13511351 end
13521352 return nothing
13531353 end
13541354 # --------------------- objective functions -------------------------------------------
13551355 function Jfunc (Z̃arg:: Vararg{T, N} ) where {N, T<: Real }
1356- update_simulations! (Z̃arg, get_tmp (Z̃_cache, T))
1356+ Z̃ = get_tmp (Z̃_cache, T)
1357+ update_simulations! (Z̃arg, Z̃)
13571358 x̄, V̂ = get_tmp (x̄_cache, T), get_tmp (V̂_cache, T)
13581359 return obj_nonlinprog! (x̄, estim, model, V̂, Z̃):: T
13591360 end
13601361 function Jfunc_vec (Z̃arg:: AbstractVector{T} ) where T<: Real
1361- update_simulations! (Z̃arg, get_tmp (Z̃_cache, T))
1362+ Z̃ = get_tmp (Z̃_cache, T)
1363+ update_simulations! (Z̃arg, Z̃)
13621364 x̄, V̂ = get_tmp (x̄_cache, T), get_tmp (V̂_cache, T)
13631365 return obj_nonlinprog! (x̄, estim, model, V̂, Z̃):: T
13641366 end
0 commit comments