|
57 | 57 | @test (@ballocated solve!($cache)) ≤ 64
|
58 | 58 | end
|
59 | 59 |
|
60 |
| - # FIXME: Even the previous tests were broken, but due to a typo in the tests they |
61 |
| - # accidentally passed |
62 | 60 | @testset "[OOP] [Immutable AD] p: $(p)" for p in 1.0:0.1:100.0
|
63 | 61 | @test begin
|
64 | 62 | res = benchmark_nlsolve_oop(quadratic_f, @SVector[1.0, 1.0], p)
|
65 | 63 | res_true = sqrt(p)
|
66 | 64 | all(res.u .≈ res_true)
|
67 | 65 | end
|
68 |
| - @test_broken ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
| 66 | + @test ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
69 | 67 | @SVector[1.0, 1.0], p).u[end], p) ≈ 1 / (2 * sqrt(p))
|
70 | 68 | end
|
71 | 69 |
|
|
101 | 99 | @test nlprob_iterator_interface(quadratic_f, p, Val(false)) ≈ sqrt.(p)
|
102 | 100 | @test nlprob_iterator_interface(quadratic_f!, p, Val(true)) ≈ sqrt.(p)
|
103 | 101 |
|
104 |
| - probN = NonlinearProblem(quadratic_f, @SVector[1.0, 1.0], 2.0) |
105 |
| - @testset "ADType: $(autodiff) u0: $(u0)" for autodiff in (false, true, |
| 102 | + @testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (false, true, |
106 | 103 | AutoSparseForwardDiff(), AutoSparseFiniteDiff(), AutoZygote(),
|
107 |
| - AutoSparseZygote(), |
108 |
| - AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0], @SVector[1.0, 1.0]) |
| 104 | + AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0]) |
109 | 105 | probN = NonlinearProblem(quadratic_f, u0, 2.0)
|
110 | 106 | @test all(solve(probN, NewtonRaphson(; autodiff)).u .≈ sqrt(2.0))
|
111 | 107 | end
|
|
149 | 145 | @test (@ballocated solve!($cache)) ≤ 64
|
150 | 146 | end
|
151 | 147 |
|
152 |
| - # FIXME: Even the previous tests were broken, but due to a typo in the tests they |
153 |
| - # accidentally passed |
154 | 148 | @testset "[OOP] [Immutable AD] radius_update_scheme: $(radius_update_scheme) p: $(p)" for radius_update_scheme in radius_update_schemes,
|
155 | 149 | p in 1.0:0.1:100.0
|
156 | 150 |
|
|
160 | 154 | res_true = sqrt(p)
|
161 | 155 | all(res.u .≈ res_true)
|
162 | 156 | end
|
163 |
| - @test_broken ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
| 157 | + @test ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
164 | 158 | @SVector[1.0, 1.0], p; radius_update_scheme).u[end], p) ≈ 1 / (2 * sqrt(p))
|
165 | 159 | end
|
166 | 160 |
|
|
204 | 198 | @test nlprob_iterator_interface(quadratic_f, p, Val(false)) ≈ sqrt.(p)
|
205 | 199 | @test nlprob_iterator_interface(quadratic_f!, p, Val(true)) ≈ sqrt.(p)
|
206 | 200 |
|
207 |
| - probN = NonlinearProblem(quadratic_f, @SVector[1.0, 1.0], 2.0) |
208 |
| - @testset "ADType: $(autodiff) u0: $(u0) radius_update_scheme: $(radius_update_scheme)" for autodiff in (false, |
| 201 | + @testset "ADType: $(autodiff) u0: $(_nameof(u0)) radius_update_scheme: $(radius_update_scheme)" for autodiff in (false, |
209 | 202 | true, AutoSparseForwardDiff(), AutoSparseFiniteDiff(), AutoZygote(),
|
210 |
| - AutoSparseZygote(), AutoSparseEnzyme()), |
211 |
| - u0 in (1.0, [1.0, 1.0], @SVector[1.0, 1.0]), |
| 203 | + AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0]), |
212 | 204 | radius_update_scheme in radius_update_schemes
|
213 | 205 |
|
214 | 206 | probN = NonlinearProblem(quadratic_f, u0, 2.0)
|
@@ -302,15 +294,13 @@ end
|
302 | 294 | @test (@ballocated solve!($cache)) ≤ 64
|
303 | 295 | end
|
304 | 296 |
|
305 |
| - # FIXME: Even the previous tests were broken, but due to a typo in the tests they |
306 |
| - # accidentally passed |
307 | 297 | @testset "[OOP] [Immutable AD] p: $(p)" for p in 1.0:0.1:100.0
|
308 | 298 | @test begin
|
309 | 299 | res = benchmark_nlsolve_oop(quadratic_f, @SVector[1.0, 1.0], p)
|
310 | 300 | res_true = sqrt(p)
|
311 | 301 | all(res.u .≈ res_true)
|
312 | 302 | end
|
313 |
| - @test_broken ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
| 303 | + @test ForwardDiff.derivative(p -> benchmark_nlsolve_oop(quadratic_f, |
314 | 304 | @SVector[1.0, 1.0], p).u[end], p) ≈ 1 / (2 * sqrt(p))
|
315 | 305 | end
|
316 | 306 |
|
|
330 | 320 | @test ForwardDiff.jacobian(p -> [benchmark_nlsolve_oop(quadratic_f2, 0.5, p).u], p) ≈
|
331 | 321 | ForwardDiff.jacobian(t, p)
|
332 | 322 |
|
333 |
| - probN = NonlinearProblem(quadratic_f, @SVector[1.0, 1.0], 2.0) |
334 |
| - @testset "ADType: $(autodiff) u0: $(u0)" for autodiff in (false, true, |
| 323 | + @testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (false, true, |
335 | 324 | AutoSparseForwardDiff(), AutoSparseFiniteDiff(), AutoZygote(),
|
336 |
| - AutoSparseZygote(), |
337 |
| - AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0], @SVector[1.0, 1.0]) |
| 325 | + AutoSparseZygote(), AutoSparseEnzyme()), u0 in (1.0, [1.0, 1.0]) |
338 | 326 | probN = NonlinearProblem(quadratic_f, u0, 2.0)
|
339 | 327 | @test all(solve(probN, LevenbergMarquardt(; autodiff)).u .≈ sqrt(2.0))
|
340 | 328 | end
|
|
0 commit comments