File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 1- using NLPModels
2- using ADNLPModels
31ndef = OptimizationProblems. default_nvar
42test_nvar = Int (round (ndef / 2 ))
53meta = OptimizationProblems. meta
@@ -60,16 +58,8 @@ function test_in_place_residual(prob::Symbol, nls::AbstractNLSModel)
6058 Fx = similar (x, nls. nls_meta. nequ)
6159 pb = String (prob)
6260 if VERSION ≥ v " 1.7" && ! occursin (" palmer" , pb) && (pb != " watson" ) # palmer residual allocate
63- # Prefer calling the user-provided in-place residual `F!` directly when
64- # available — ADNLPModels.residual! may allocate internal temporaries.
65- if hasfield (typeof (nls), Symbol (" F!" ))
66- f = getfield (nls, Symbol (" F!" ))
67- @allocated f (Fx, x)
68- @test (@allocated f (Fx, x)) == 0
69- else
70- @allocated residual! (nls, x, Fx)
71- @test (@allocated residual! (nls, x, Fx)) == 0
72- end
61+ @allocated residual! (nls, x, Fx)
62+ @test (@allocated residual! (nls, x, Fx)) == 0
7363 end
7464 m = OptimizationProblems. eval (Meta. parse (" get_$(prob) _nls_nequ" ))()
7565 @test nls. nls_meta. nequ == m
You can’t perform that action at this time.
0 commit comments