Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 51b3608

Browse files
committed
Fix the tests
1 parent 3cea457 commit 51b3608

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/nlsolve/trustRegion.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SimpleTrustRegion, args.
9696
fₖ₊₁ = norm(fx)^2 / T(2)
9797

9898
# Compute the ratio of the actual to predicted reduction.
99-
# @show size(H), size(δ)
10099
@bb= H × vec(δ)
101100
r = (fₖ₊₁ - fₖ) / (dot', g) + dot', Hδ) / T(2))
102101

test/23_test_problems.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using SimpleNonlinearSolve, LinearAlgebra, NonlinearProblemLibrary, Test
1+
using SimpleNonlinearSolve, LinearAlgebra, NonlinearProblemLibrary, DiffEqBase, Test
22

33
problems = NonlinearProblemLibrary.problems
44
dicts = NonlinearProblemLibrary.dicts
@@ -23,7 +23,8 @@ function test_on_library(problems, dicts, alg_ops, broken_tests, ϵ = 1e-4;
2323
end
2424
broken = idx in broken_tests[alg] ? true : false
2525
@test norm(res)ϵ broken=broken
26-
catch
26+
catch e
27+
@error e
2728
broken = idx in broken_tests[alg] ? true : false
2829
if broken
2930
@test false broken=true
@@ -69,7 +70,7 @@ end
6970
alg_ops = (SimpleBroyden(),)
7071

7172
broken_tests = Dict(alg => Int[] for alg in alg_ops)
72-
broken_tests[alg_ops[1]] = [1, 2, 4, 5, 6, 11, 12, 13, 14]
73+
broken_tests[alg_ops[1]] = [1, 4, 5, 6, 11, 12, 13, 14]
7374

7475
skip_tests = Dict(alg => Int[] for alg in alg_ops)
7576
skip_tests[alg_ops[1]] = [22]

test/basictests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ end
156156
u0 in (1.0, [1.0, 1.0], @SVector[1.0, 1.0])
157157

158158
probN = NonlinearProblem(quadratic_f, u0, 2.0)
159-
@show solve(probN, SimpleHalley(); termination_condition).u
160159
@test all(solve(probN, SimpleHalley(); termination_condition).u .≈ sqrt(2.0))
161160
end
162161
end
@@ -301,6 +300,7 @@ end
301300
end
302301

303302
@testset "Tolerance Tests Interval Methods: $(alg)" for alg in (Bisection(), Falsi(), ITP())
303+
tspan = (1.0, 20.0)
304304
probB = IntervalNonlinearProblem(quadratic_f, tspan, 2.0)
305305
tols = [0.1, 0.01, 0.001, 0.0001, 1e-5, 1e-6, 1e-7]
306306
ϵ = eps(1.0) #least possible tol for all methods
@@ -313,6 +313,7 @@ end
313313
end
314314

315315
@testset "Tolerance Tests Interval Methods: $(alg)" for alg in (Ridder(), Brent())
316+
tspan = (1.0, 20.0)
316317
probB = IntervalNonlinearProblem(quadratic_f, tspan, 2.0)
317318
tols = [0.1] # Ridder and Brent converge rapidly so as we lower tolerance below 0.01, it converges with max precision to the solution
318319
ϵ = eps(1.0) #least possible tol for all methods

test/matrix_resizing_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ prob = NonlinearProblem(ff, u0, p)
88

99
@testset "$(alg)" for alg in (SimpleKlement(), SimpleBroyden(), SimpleNewtonRaphson(),
1010
SimpleDFSane(), SimpleLimitedMemoryBroyden(), SimpleTrustRegion())
11-
@test vec(solve(prob, alg).u) == solve(vecprob, alg).u
11+
@test vec(solve(prob, alg).u) solve(vecprob, alg).u
1212
end

0 commit comments

Comments
 (0)