Skip to content

Commit

Permalink
Add Halley to 23 test problems
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 26, 2024
1 parent fb2f20d commit 29ae939
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
23 changes: 18 additions & 5 deletions test/core/23_test_problems_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ end
export problems, dicts, test_on_library
end

@testitem "SimpleNewtonRaphson" setup=[RobustnessTesting] tags=[:core] begin
@testitem "23 Test Problems: SimpleNewtonRaphson" setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleNewtonRaphson(),)

broken_tests = Dict(alg => Int[] for alg in alg_ops)
Expand All @@ -50,7 +50,20 @@ end
test_on_library(problems, dicts, alg_ops, broken_tests)
end

@testitem "SimpleTrustRegion" setup=[RobustnessTesting] tags=[:core] begin
@testitem "23 Test Problems: SimpleHalley" setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleHalley(),)

broken_tests = Dict(alg => Int[] for alg in alg_ops)
if Sys.isapple()
broken_tests[alg_ops[1]] = [1, 5, 11, 15, 16, 18]
else
broken_tests[alg_ops[1]] = [1, 5, 15, 16, 18]
end

test_on_library(problems, dicts, alg_ops, broken_tests)
end

@testitem "23 Test Problems: SimpleTrustRegion" setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleTrustRegion(), SimpleTrustRegion(; nlsolve_update_rule = Val(true)))

broken_tests = Dict(alg => Int[] for alg in alg_ops)
Expand All @@ -60,7 +73,7 @@ end
test_on_library(problems, dicts, alg_ops, broken_tests)
end

@testitem "SimpleDFSane" setup=[RobustnessTesting] tags=[:core] begin
@testitem "23 Test Problems: SimpleDFSane" setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleDFSane(),)

broken_tests = Dict(alg => Int[] for alg in alg_ops)
Expand All @@ -73,7 +86,7 @@ end
test_on_library(problems, dicts, alg_ops, broken_tests)
end

@testitem "SimpleBroyden" retries=5 setup=[RobustnessTesting] tags=[:core] begin
@testitem "23 Test Problems: SimpleBroyden" retries=5 setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleBroyden(),)

broken_tests = Dict(alg => Int[] for alg in alg_ops)
Expand All @@ -82,7 +95,7 @@ end
test_on_library(problems, dicts, alg_ops, broken_tests)
end

@testitem "SimpleKlement" setup=[RobustnessTesting] tags=[:core] begin
@testitem "23 Test Problems: SimpleKlement" setup=[RobustnessTesting] tags=[:core] begin
alg_ops = (SimpleKlement(),)

broken_tests = Dict(alg => Int[] for alg in alg_ops)
Expand Down
6 changes: 6 additions & 0 deletions test/core/rootfind_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ end
@test SciMLBase.successful_retcode(sol)
@test all(abs.(sol.u .* sol.u .- 2) .< 1e-9)
end

@testset "[IIP] u0: $(nameof(typeof(u0)))" for u0 in ([1.0, 1.0],)
sol = benchmark_nlsolve_iip(quadratic_f!, u0; solver = SimpleHalley(; autodiff))
@test SciMLBase.successful_retcode(sol)
@test all(abs.(sol.u .* sol.u .- 2) .< 1e-9)
end
end

@testset "Termination condition: $(nameof(typeof(termination_condition))) u0: $(nameof(typeof(u0)))" for termination_condition in TERMINATION_CONDITIONS,
Expand Down

0 comments on commit 29ae939

Please sign in to comment.