Skip to content

Commit d508712

Browse files
committed
Fix an error in sparsity_pattern.jl
1 parent 6c5578d commit d508712

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sparsity_pattern.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ function get_sparsity_pattern(model::ADModel, derivate::Symbol)
8484
if (derivate == :jacobian) || (derivate == :jacobian_residual)
8585
backend = derivate == :jacobian ? model.adbackend.jacobian_backend : model.adbackend.jacobian_residual_backend
8686
if backend isa SparseADJacobian
87-
m = model.meta.nvar
88-
n = derivate == :jacobian ? model.meta.ncon : model.nls_meta.nequ
87+
m = derivate == :jacobian ? model.meta.ncon : model.nls_meta.nequ
88+
n = model.meta.nvar
8989
colptr = backend.colptr
9090
rowval = backend.rowval
9191
nnzJ = length(rowval)

0 commit comments

Comments
 (0)