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

Commit c3705e4

Browse files
Support complex in newton
1 parent 5515453 commit c3705e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ 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 : real(oneunit(eltype(T))) * (eps(real(one(eltype(T)))))^(4 // 5)
53+
rtol = reltol !== nothing ? reltol : eps(real(one(eltype(T))))^(4 // 5)
5454

5555
if typeof(x) <: Number
5656
xo = oftype(one(eltype(x)), Inf)

0 commit comments

Comments
 (0)