@@ -91,19 +91,9 @@ for (h, h_name) ∈ ((NormL0(λ), "l0"), (NormL1(λ), "l1"), (IndBallL0(10 * com
9191 x0[p[1 : nz]] = sign .(randn (nz)) # initial guess with nz nonzeros (necessary for h = B0)
9292 args = solver_sym == :LM ? () : (NormLinf (1.0 ),)
9393 out = solver (bpdn_nls, h, args... , options, x0 = x0)
94- @test typeof (out. solution) == typeof (bpdn_nls. meta. x0)
95- @test length (out. solution) == bpdn_nls. meta. nvar
96- @test typeof (out. solver_specific[:Fhist ]) == typeof (out. solution)
97- @test typeof (out. solver_specific[:Hhist ]) == typeof (out. solution)
98- @test typeof (out. solver_specific[:SubsolverCounter ]) == Array{Int, 1 }
94+ @test typeof (out. solution) == typeof (bpdn. meta. x0)
95+ @test length (out. solution) == bpdn. meta. nvar
9996 @test typeof (out. dual_feas) == eltype (out. solution)
100- @test length (out. solver_specific[:Fhist ]) == length (out. solver_specific[:Hhist ])
101- @test length (out. solver_specific[:Fhist ]) == length (out. solver_specific[:SubsolverCounter ])
102- @test length (out. solver_specific[:Fhist ]) == length (out. solver_specific[:NLSGradHist ])
103- @test out. solver_specific[:NLSGradHist ][end ] ==
104- bpdn_nls. counters. neval_jprod_residual + bpdn_nls. counters. neval_jtprod_residual - 1
105- @test obj (bpdn_nls, out. solution) == out. solver_specific[:Fhist ][end ]
106- @test h (out. solution) == out. solver_specific[:Hhist ][end ]
10797 @test out. status == :first_order
10898 end
10999 end
@@ -116,20 +106,9 @@ for (h, h_name) ∈ ((NormL1(λ), "l1"),)
116106 p = randperm (bpdn_nls. meta. nvar)[1 : nz]
117107 x0[p[1 : nz]] = sign .(randn (nz)) # initial guess with nz nonzeros (necessary for h = B0)
118108 LMTR_out = LMTR (bpdn_nls, h, NormL2 (1.0 ), options, x0 = x0)
119- @test typeof (LMTR_out. solution) == typeof (bpdn_nls. meta. x0)
120- @test length (LMTR_out. solution) == bpdn_nls. meta. nvar
121- @test typeof (LMTR_out. solver_specific[:Fhist ]) == typeof (LMTR_out. solution)
122- @test typeof (LMTR_out. solver_specific[:Hhist ]) == typeof (LMTR_out. solution)
123- @test typeof (LMTR_out. solver_specific[:SubsolverCounter ]) == Array{Int, 1 }
109+ @test typeof (LMTR_out. solution) == typeof (bpdn. meta. x0)
110+ @test length (LMTR_out. solution) == bpdn. meta. nvar
124111 @test typeof (LMTR_out. dual_feas) == eltype (LMTR_out. solution)
125- @test length (LMTR_out. solver_specific[:Fhist ]) == length (LMTR_out. solver_specific[:Hhist ])
126- @test length (LMTR_out. solver_specific[:Fhist ]) ==
127- length (LMTR_out. solver_specific[:SubsolverCounter ])
128- @test length (LMTR_out. solver_specific[:Fhist ]) == length (LMTR_out. solver_specific[:NLSGradHist ])
129- @test LMTR_out. solver_specific[:NLSGradHist ][end ] ==
130- bpdn_nls. counters. neval_jprod_residual + bpdn_nls. counters. neval_jtprod_residual - 1
131- @test obj (bpdn_nls, LMTR_out. solution) == LMTR_out. solver_specific[:Fhist ][end ]
132- @test h (LMTR_out. solution) == LMTR_out. solver_specific[:Hhist ][end ]
133112 @test LMTR_out. status == :first_order
134113 end
135114end
0 commit comments