From d81578500bd3c5c0862a8e4a469ca72a4334e5c8 Mon Sep 17 00:00:00 2001 From: Songchen Tan Date: Thu, 2 May 2024 17:23:54 -0400 Subject: [PATCH] Add Halley to 23 problems tests --- test/core/23_test_problems_tests.jl | 9 +++++++++ test/misc/halley_tests.jl | 16 ---------------- 2 files changed, 9 insertions(+), 16 deletions(-) delete mode 100644 test/misc/halley_tests.jl diff --git a/test/core/23_test_problems_tests.jl b/test/core/23_test_problems_tests.jl index b0f17113a..00b513d4e 100644 --- a/test/core/23_test_problems_tests.jl +++ b/test/core/23_test_problems_tests.jl @@ -59,6 +59,15 @@ end test_on_library(problems, dicts, alg_ops, broken_tests) end +@testitem "Halley" setup=[RobustnessTesting] begin + alg_ops = (Halley(),) + + broken_tests = Dict(alg => Int[] for alg in alg_ops) + broken_tests[alg_ops[1]] = [1, 5, 8, 15, 16] + + test_on_library(problems, dicts, alg_ops, broken_tests) +end + @testitem "TrustRegion" setup=[RobustnessTesting] begin alg_ops = (TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Simple), TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Fan), diff --git a/test/misc/halley_tests.jl b/test/misc/halley_tests.jl deleted file mode 100644 index a270942a0..000000000 --- a/test/misc/halley_tests.jl +++ /dev/null @@ -1,16 +0,0 @@ -@testitem "Halley method" begin - f(u, p) = u .* u .- p - f!(fu, u, p) = fu .= u .* u .- p - u0 = [1.0, 1.0] - p = 2.0 - - # out-of-place - prob1 = NonlinearProblem(f, u0, p) - sol1 = solve(prob1, Halley()) - @test sol1.u ≈ [sqrt(2.0), sqrt(2.0)] - - # in-place - prob2 = NonlinearProblem(f!, u0, p) - sol2 = solve(prob2, Halley()) - @test sol2.u ≈ [sqrt(2.0), sqrt(2.0)] -end