Skip to content

Commit ac1ea26

Browse files
authored
Add testsets in consistent_nlps (#135)
1 parent 99549fa commit ac1ea26

File tree

3 files changed

+784
-598
lines changed

3 files changed

+784
-598
lines changed

src/allocs_model.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ function test_allocs_nlpmodels(nlp::AbstractNLPModel; linear_api = false, exclud
109109
nlp_allocations[:jtprod!] = @allocated jtprod!(nlp, x, v, Jtv)
110110
end
111111

112-
if get_ncon(nlp) > 0 &&
113-
!(jac_op in exclude) &&
114-
nlp.meta.jprod_available &&
115-
nlp.meta.jtprod_available
112+
if get_ncon(nlp) > 0 && !(jac_op in exclude) && nlp.meta.jprod_available && nlp.meta.jtprod_available
116113
x = get_x0(nlp)
117114
Jtv = similar(x)
118115
Jv = Vector{eltype(x)}(undef, get_ncon(nlp))
@@ -133,6 +130,7 @@ function test_allocs_nlpmodels(nlp::AbstractNLPModel; linear_api = false, exclud
133130
if !linear_api || (nn == 0)
134131
continue
135132
end
133+
136134
if !(cons in exclude)
137135
x = get_x0(nlp)
138136
c = Vector{eltype(x)}(undef, nn)
@@ -300,8 +298,8 @@ function test_allocs_nlsmodels(nls::AbstractNLSModel; exclude = [])
300298
end
301299

302300
if !(jac_op_residual in exclude) &&
303-
nls_meta(nls).jprod_residual_available &&
304-
nls_meta(nls).jtprod_residual_available
301+
nls_meta(nls).jprod_residual_available &&
302+
nls_meta(nls).jtprod_residual_available
305303
x = get_x0(nls)
306304
Jtv = similar(x)
307305
Jv = Vector{eltype(x)}(undef, get_nequ(nls))
@@ -337,6 +335,7 @@ function test_allocs_nlsmodels(nls::AbstractNLSModel; exclude = [])
337335
hprod_residual!(nls, x, i, v, Hv)
338336
nls_allocations[:hprod_residual!] = @allocated hprod_residual!(nls, x, i, v, Hv)
339337
end
338+
340339
if !(hess_op_residual in exclude) && nls_meta(nls).jprod_residual_available
341340
x = get_x0(nls)
342341
Hv = similar(x)

0 commit comments

Comments
 (0)