Skip to content

Commit 6f72934

Browse files
committed
debug: correct sparsity detection for MovingHorizonEstimator
1 parent c713f61 commit 6f72934

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/estimator/mhe/construct.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,8 +1406,10 @@ function get_optim_functions(
14061406
# temporarily enable all the inequality constraints for sparsity pattern detection:
14071407
i_g_old = copy(estim.con.i_g)
14081408
estim.con.i_g .= true
1409+
estim.Nk .= estim.He
14091410
∇g_prep = prepare_jacobian(gfunc!, g, jac_backend, Z̃_∇g, ∇g_context...)
14101411
estim.con.i_g .= i_g_old
1412+
estim.Nk .= 0
14111413
∇g = init_diffmat(JNT, jac_backend, ∇g_prep, nZ̃, ng)
14121414
∇gfuncs! = Vector{Function}(undef, ng)
14131415
for i in eachindex(∇gfuncs!)

0 commit comments

Comments
 (0)