@@ -1343,22 +1343,24 @@ function get_optim_functions(
1343
1343
end
1344
1344
Z̃ = Z̃cache
1345
1345
ϵ = (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 )
1349
1349
V̂, X̂0 = predict! (V̂, X̂0, û0, ŷ0, estim, model, Z̃)
1350
1350
g = con_nonlinprog! (g, estim, model, X̂0, V̂, ϵ)
1351
1351
end
1352
1352
return nothing
1353
1353
end
1354
1354
# --------------------- objective functions -------------------------------------------
1355
1355
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̃)
1357
1358
x̄, V̂ = get_tmp (x̄_cache, T), get_tmp (V̂_cache, T)
1358
1359
return obj_nonlinprog! (x̄, estim, model, V̂, Z̃):: T
1359
1360
end
1360
1361
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̃)
1362
1364
x̄, V̂ = get_tmp (x̄_cache, T), get_tmp (V̂_cache, T)
1363
1365
return obj_nonlinprog! (x̄, estim, model, V̂, Z̃):: T
1364
1366
end
0 commit comments