Skip to content

Commit

Permalink
Merge pull request #1 from SciML/tols
Browse files Browse the repository at this point in the history
fix tolerances
  • Loading branch information
ChrisRackauckas authored Nov 23, 2022
2 parents 7c6e654 + b7b6771 commit 2838651
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 37 deletions.
4 changes: 2 additions & 2 deletions lib/SimpleNonlinearSolve/.github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CI
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
jobs:
test:
runs-on: ubuntu-latest
Expand Down
29 changes: 0 additions & 29 deletions lib/SimpleNonlinearSolve/.github/workflows/Documentation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/SimpleNonlinearSolve/.github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: IntegrationTest
on:
push:
branches: [master]
branches: [main]
tags: [v*]
pull_request:

Expand Down
2 changes: 1 addition & 1 deletion lib/SimpleNonlinearSolve/.github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: format-check
on:
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
pull_request:
Expand Down
8 changes: 4 additions & 4 deletions lib/SimpleNonlinearSolve/src/raphson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ struct SimpleNewtonRaphson{CS, AD, FDT} <: AbstractNewtonAlgorithm{CS, AD, FDT}
end

function SciMLBase.solve(prob::NonlinearProblem,
alg::SimpleNewtonRaphson, args...; xatol = nothing,
xrtol = nothing,
alg::SimpleNewtonRaphson, args...; abstol = nothing,
reltol = nothing,
maxiters = 1000, kwargs...)
f = Base.Fix2(prob.f, prob.p)
x = float(prob.u0)
Expand All @@ -19,8 +19,8 @@ function SciMLBase.solve(prob::NonlinearProblem,
error("SimpleNewtonRaphson currently only supports out-of-place nonlinear problems")
end

atol = xatol !== nothing ? xatol : oneunit(eltype(T)) * (eps(one(eltype(T))))^(4 // 5)
rtol = xrtol !== nothing ? xrtol : eps(one(eltype(T)))^(4 // 5)
atol = abstol !== nothing ? abstol : oneunit(eltype(T)) * (eps(one(eltype(T))))^(4 // 5)
rtol = reltol !== nothing ? reltol : eps(one(eltype(T)))^(4 // 5)

if typeof(x) <: Number
xo = oftype(one(eltype(x)), Inf)
Expand Down

0 comments on commit 2838651

Please sign in to comment.