Skip to content

Commit 83db3f3

Browse files
authored
[documentation] Improve the docstring of SimpleStats (#917)
* [documentation] Improve the docstring of SimpleStats * Update src/krylov_stats.jl * Update src/krylov_stats.jl
1 parent 58b5cff commit 83db3f3

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

src/krylov_stats.jl

+24-16
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ import Base.copyto!
77
abstract type KrylovStats{T} end
88

99
"""
10-
Type for statistics returned by the majority of Krylov solvers, the attributes are:
11-
- niter
12-
- solved
13-
- inconsistent
14-
- residuals
15-
- Aresiduals
16-
- Acond
17-
- timer
18-
- status
10+
Type for storing statistics returned by the majority of Krylov solvers.
11+
The fields are as follows:
12+
- `niter`: The total number of iterations completed by the solver;
13+
- `solved`: Indicates whether the solver successfully reached convergence (`true` if solved, ``false` otherwise);
14+
- `inconsistent`: Flags whether the system was detected as inconsistent (i.e., when `b` is not in the range of `A`);
15+
- `residuals`: A vector containing the residual norms at each iteration;
16+
- `Aresiduals`: A vector of `A'`-residual norms at each iteration;
17+
- `Acond`: An estimate of the condition number of matrix `A`.
18+
- `timer`: The elapsed time (in seconds) taken by the solver to complete all iterations;
19+
- `status`: A string indicating the outcome of the solve, providing additional details beyond `solved`.
1920
"""
2021
mutable struct SimpleStats{T} <: KrylovStats{T}
2122
niter :: Int
@@ -47,7 +48,8 @@ function copyto!(dest :: SimpleStats, src :: SimpleStats)
4748
end
4849

4950
"""
50-
Type for statistics returned by LSMR. The attributes are:
51+
Type for storing statistics returned by LSMR.
52+
The fields are as follows:
5153
- niter
5254
- solved
5355
- inconsistent
@@ -96,7 +98,8 @@ function copyto!(dest :: LsmrStats, src :: LsmrStats)
9698
end
9799

98100
"""
99-
Type for statistics returned by CG-LANCZOS, the attributes are:
101+
Type for storing statistics returned by CG-LANCZOS.
102+
The fields are as follows:
100103
- niter
101104
- solved
102105
- residuals
@@ -134,7 +137,8 @@ function copyto!(dest :: LanczosStats, src :: LanczosStats)
134137
end
135138

136139
"""
137-
Type for statistics returned by CG-LANCZOS with shifts, the attributes are:
140+
Type for storing statistics returned by CG-LANCZOS-SHIFT and CGLS-LANCZOS-SHIFT.
141+
The fields are as follows:
138142
- niter
139143
- solved
140144
- residuals
@@ -174,7 +178,8 @@ function copyto!(dest :: LanczosShiftStats, src :: LanczosShiftStats)
174178
end
175179

176180
"""
177-
Type for statistics returned by SYMMLQ, the attributes are:
181+
Type for storing statistics returned by SYMMLQ.
182+
The fields are as follows:
178183
- niter
179184
- solved
180185
- residuals
@@ -221,7 +226,8 @@ function copyto!(dest :: SymmlqStats, src :: SymmlqStats)
221226
end
222227

223228
"""
224-
Type for statistics returned by adjoint systems solvers BiLQR and TriLQR, the attributes are:
229+
Type for storing statistics returned by adjoint systems solvers BiLQR and TriLQR.
230+
The fields are as follows:
225231
- niter
226232
- solved_primal
227233
- solved_dual
@@ -258,7 +264,8 @@ end
258264

259265

260266
"""
261-
Type for statistics returned by the LNLQ method, the attributes are:
267+
Type for storing statistics returned by the LNLQ method.
268+
The fields are as follows:
262269
- niter
263270
- solved
264271
- residuals
@@ -298,7 +305,8 @@ function copyto!(dest :: LNLQStats, src :: LNLQStats)
298305
end
299306

300307
"""
301-
Type for statistics returned by the LSLQ method, the attributes are:
308+
Type for storing statistics returned by the LSLQ method.
309+
The fields are as follows:
302310
- niter
303311
- solved
304312
- inconsistent

0 commit comments

Comments
 (0)