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

Commit 92b2eb2

Browse files
Merge pull request #12 from SciML/complex
Support complex in newton
2 parents 5515453 + fd62cce commit 92b2eb2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
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 = "0.1.3"
4+
version = "0.1.4"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

src/raphson.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ function SciMLBase.solve(prob::NonlinearProblem,
4949
error("SimpleNewtonRaphson currently only supports out-of-place nonlinear problems")
5050
end
5151

52-
atol = abstol !== nothing ? abstol : oneunit(eltype(T)) * (eps(one(eltype(T))))^(4 // 5)
53-
rtol = reltol !== nothing ? reltol : eps(one(eltype(T)))^(4 // 5)
52+
atol = abstol !== nothing ? abstol :
53+
real(oneunit(eltype(T))) * (eps(real(one(eltype(T)))))^(4 // 5)
54+
rtol = reltol !== nothing ? reltol : eps(real(one(eltype(T))))^(4 // 5)
5455

5556
if typeof(x) <: Number
5657
xo = oftype(one(eltype(x)), Inf)
@@ -78,5 +79,7 @@ function SciMLBase.solve(prob::NonlinearProblem,
7879
end
7980
xo = x
8081
end
82+
83+
@show x, fx
8184
return SciMLBase.build_solution(prob, alg, x, fx; retcode = ReturnCode.MaxIters)
8285
end

0 commit comments

Comments
 (0)