Skip to content

Commit 301f874

Browse files
committed
Add bigfloat tests
1 parent 3f37005 commit 301f874

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ LinearAlgebra = "1.10"
8080
LinearSolve = "2.30"
8181
MINPACK = "1.2"
8282
MaybeInplace = "0.1.3"
83-
ModelingToolkit = "9.13.0"
83+
ModelingToolkit = "9.15.0"
8484
NLSolvers = "0.5"
8585
NLsolve = "4.5"
8686
NaNMath = "1"

test/misc/exotic_type_tests.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# File for different types of exotic types
2+
@testsetup module NonlinearSolveExoticTypeTests
3+
using NonlinearSolve
4+
5+
fn_iip = NonlinearFunction{true}((du, u, p) -> du .= u .* u .- p)
6+
fn_oop = NonlinearFunction{false}((u, p) -> u .* u .- p)
7+
8+
u0 = BigFloat[1.0, 1.0, 1.0]
9+
prob_iip_bf = NonlinearProblem{true}(fn_iip, u0, BigFloat(2))
10+
prob_oop_bf = NonlinearProblem{false}(fn_oop, u0, BigFloat(2))
11+
12+
export fn_iip, fn_oop, u0, prob_iip_bf, prob_oop_bf
13+
end
14+
15+
@testitem "BigFloat Support" tags=[:misc] setup=[NonlinearSolveExoticTypeTests] begin
16+
using NonlinearSolve, LinearAlgebra
17+
18+
for alg in [NewtonRaphson(), Broyden(), Klement(), DFSane(), TrustRegion()]
19+
sol = solve(prob_oop_bf, alg)
20+
@test norm(sol.resid, Inf) < 1e-6
21+
@test SciMLBase.successful_retcode(sol.retcode)
22+
23+
sol = solve(prob_iip_bf, alg)
24+
@test norm(sol.resid, Inf) < 1e-6
25+
@test SciMLBase.successful_retcode(sol.retcode)
26+
end
27+
end

0 commit comments

Comments
 (0)