Skip to content

Commit 37be20b

Browse files
committed
change rtol and atol defaults
1 parent 8ff4866 commit 37be20b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/specs/stdlib_linalg_iterative_solvers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Subroutine
152152

153153
`di` (optional): 1-D mask array of type `logical(int8)` defining the degrees of freedom subject to dirichlet boundary conditions. The actual boundary conditions values should be stored in the `b` load array. This argument is `intent(in)`.
154154

155-
`rtol` and `atol` (optional): scalars of type `real(<kind>)` specifying the convergence test. For convergence, the following criterion is used \( || b - Ax ||^2 <= max(rtol^2 * || b ||^2 , atol^2 ) \). Defaults values are `rtol=1.e-4` and `atol=0`. These arguments are `intent(in)`.
155+
`rtol` and `atol` (optional): scalars of type `real(<kind>)` specifying the convergence test. For convergence, the following criterion is used \( || b - Ax ||^2 <= max(rtol^2 * || b ||^2 , atol^2 ) \). Defaults values are `rtol=1.e-5` and `atol=epsilon(1._<kind>)`. These arguments are `intent(in)`.
156156

157157
`maxiter` (optional): scalar of type `integer` defining the maximum allowed number of iterations. If no value is given, a default of `N` is set, where `N = size(b)`. This argument is `intent(in)`.
158158

@@ -234,7 +234,7 @@ Subroutine
234234

235235
`di` (optional): 1-D mask array of type `logical(int8)` defining the degrees of freedom subject to dirichlet boundary conditions. The actual boundary conditions values should be stored in the `b` load array. This argument is `intent(in)`.
236236

237-
`rtol` and `atol` (optional): scalars of type `real(<kind>)` specifying the convergence test. For convergence, the following criterion is used \( || b - Ax ||^2 <= max(rtol^2 * || b ||^2 , atol^2 ) \). Defaults values are `rtol=1.e-4` and `atol=0`. These arguments are `intent(in)`.
237+
`rtol` and `atol` (optional): scalars of type `real(<kind>)` specifying the convergence test. For convergence, the following criterion is used \( || b - Ax ||^2 <= max(rtol^2 * || b ||^2 , atol^2 ) \). Defaults values are `rtol=1.e-5` and `atol=epsilon(1._<kind>)`. These arguments are `intent(in)`.
238238

239239
`maxiter` (optional): scalar of type `integer` defining the maximum allowed number of iterations. If no value is given, a default of `N` is set, where `N = size(b)`. This argument is `intent(in)`.
240240

src/stdlib_linalg_iterative_solvers_cg.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ contains
9191
n = size(b)
9292
maxiter_ = optval(x=maxiter, default=n)
9393
restart_ = optval(x=restart, default=.true.)
94-
rtol_ = optval(x=rtol, default=1.e-4_${s}$)
95-
atol_ = optval(x=atol, default=zero_${s}$)
94+
rtol_ = optval(x=rtol, default=1.e-5_${s}$)
95+
atol_ = optval(x=atol, default=epsilon(one_${s}$))
9696

9797
!-------------------------
9898
! internal memory setup

src/stdlib_linalg_iterative_solvers_pcg.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ contains
117117
n = size(b)
118118
maxiter_ = optval(x=maxiter, default=n)
119119
restart_ = optval(x=restart, default=.true.)
120-
rtol_ = optval(x=rtol, default=1.e-4_${s}$)
121-
atol_ = optval(x=atol, default=zero_${s}$)
120+
rtol_ = optval(x=rtol, default=1.e-5_${s}$)
121+
atol_ = optval(x=atol, default=epsilon(one_${s}$))
122122
precond_ = optval(x=precond, default=pc_none)
123123
!-------------------------
124124
! internal memory setup

0 commit comments

Comments
 (0)