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

Commit ffb5d26

Browse files
committed
Support BigFloat
1 parent e23cca8 commit ffb5d26

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleNonlinearSolve"
22
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
33
authors = ["SciML"]
4-
version = "1.8.1"
4+
version = "1.8.2"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -50,7 +50,7 @@ FiniteDiff = "2.22"
5050
ForwardDiff = "0.10.36"
5151
LinearAlgebra = "1.10"
5252
LinearSolve = "2.30"
53-
MaybeInplace = "0.1.1"
53+
MaybeInplace = "0.1.3"
5454
NonlinearProblemLibrary = "0.1.2"
5555
Pkg = "1.10"
5656
PolyesterForwardDiff = "0.1.1"

test/core/exotic_type_tests.jl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# File for different types of exotic types
2+
@testsetup module SimpleNonlinearSolveExoticTypeTests
3+
using SimpleNonlinearSolve
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=[:core] setup=[SimpleNonlinearSolveExoticTypeTests] begin
16+
using SimpleNonlinearSolve, LinearAlgebra
17+
18+
for alg in [SimpleNewtonRaphson(), SimpleBroyden(), SimpleKlement(), SimpleDFSane(),
19+
SimpleTrustRegion(), SimpleLimitedMemoryBroyden(; threshold = 2),
20+
SimpleHalley()]
21+
sol = solve(prob_oop_bf, alg)
22+
@test norm(sol.resid, Inf) < 1e-6
23+
@test SciMLBase.successful_retcode(sol.retcode)
24+
25+
alg isa SimpleHalley && continue
26+
27+
sol = solve(prob_iip_bf, alg)
28+
@test norm(sol.resid, Inf) < 1e-6
29+
@test SciMLBase.successful_retcode(sol.retcode)
30+
end
31+
end

test/gpu/cuda_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Solving on GPUs" tags=[:cuda] begin
1+
@testitem "Solving on GPUs" tags=[:cuda] skip=:(using CUDA; !CUDA.functional()) begin
22
using StaticArrays, CUDA
33

44
CUDA.allowscalar(false)
@@ -36,7 +36,7 @@
3636
end
3737
end
3838

39-
@testitem "CUDA Kernel Launch Test" tags=[:cuda] begin
39+
@testitem "CUDA Kernel Launch Test" tags=[:cuda] skip=:(using CUDA; !CUDA.functional()) begin
4040
using StaticArrays, CUDA
4141

4242
CUDA.allowscalar(false)

0 commit comments

Comments
 (0)