File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using Test
2- using ADNLPModels, DifferentialEquations
1+ using LinearAlgebra, Test
2+ using ADNLPModels, DifferentialEquations, NLPModels
33using RegularizedProblems
44
55@testset " BPDN" begin
@@ -14,6 +14,15 @@ using RegularizedProblems
1414 @test nls_model. meta. nvar == 512
1515 @test nls_model. nls_meta. nequ == 200
1616 @test all (nls_model. meta. x0 .== 0 )
17+
18+ x = fill! (similar (model. meta. x0), 1 )
19+ f = obj (model, x)
20+ F = residual (nls_model, x)
21+ @test f ≈ dot (F, F) / 2
22+
23+ g = grad (model, x)
24+ JtF = jtprod_residual (nls_model, x, F)
25+ @test all (g .≈ JtF)
1726end
1827
1928@testset " FH" begin
2837 @test nls_model. meta. nvar == 5
2938 @test nls_model. nls_meta. nequ == 202
3039 @test all (nls_model. meta. x0 .== 1 )
40+
41+ x = model. meta. x0
42+ f = obj (model, x)
43+ F = residual (nls_model, x)
44+ @test f ≈ dot (F, F) / 2
45+
46+ g = grad (model, x)
47+ JtF = jtprod_residual (nls_model, x, F)
48+ @test all (g .≈ JtF)
3149end
You can’t perform that action at this time.
0 commit comments