You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/inplace.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
## [In-place methods](@id in-place)
2
2
3
3
All solvers in Krylov.jl have an in-place variant implemented in a method whose name ends with `!`.
4
-
A workspace (`KrylovSolver`), which contains the storage needed by a Krylov method, can be used to solve multiple linear systems with the same dimensions and the same floating-point precision.
4
+
A workspace (`KrylovWorkspace`), which contains the storage needed by a Krylov method, can be used to solve multiple linear systems with the same dimensions and the same floating-point precision.
5
5
The section [storage requirements](@ref storage-requirements) specifies the memory needed for each Krylov method.
6
6
7
-
Each `KrylovSolver` has three constructors with consistent argument patterns:
7
+
Each `KrylovWorkspace` has three constructors with consistent argument patterns:
8
8
9
9
```@constructors
10
-
XyzSolver(A, b)
11
-
XyzSolver(m, n, S)
12
-
XyzSolver(kc::KrylovConstructor)
10
+
XyzWorkspace(A, b)
11
+
XyzWorkspace(m, n, S)
12
+
XyzWorkspace(kc::KrylovConstructor)
13
13
```
14
-
The only exceptions are `CgLanczosShiftSolver` and `CglsLanczosShiftSolver`, which require an additional argument `nshifts`.
14
+
The only exceptions are `CgLanczosShiftWorkspace` and `CglsLanczosShiftWorkspace`, which require an additional argument `nshifts`.
15
15
Additionally, some constructors accept keyword arguments.
16
16
17
17
`Xyz` represents the name of the Krylov method, written in lowercase except for its first letter (such as `Cg`, `Minres`, `Lsmr` or `Bicgstab`).
18
-
If the name of the Krylov method contains an underscore (e.g., `minres_qlp` or `cgls_lanczos_shift`), the workspace constructor transforms it by capitalizing each word and removing underscores, resulting in names like `MinresQlpSolver` or `CglsLanczosShiftSolver`.
18
+
If the name of the Krylov method contains an underscore (e.g., `minres_qlp` or `cgls_lanczos_shift`), the workspace constructor transforms it by capitalizing each word and removing underscores, resulting in names like `MinresQlpWorkspace` or `CglsLanczosShiftWorkspace`.
19
19
20
-
Given an operator `A` and a right-hand side `b`, you can create a `KrylovSolver` based on the size of `A` and the type of `b`, or explicitly provide the dimensions `(m, n)` and the storage type `S`.
20
+
Given an operator `A` and a right-hand side `b`, you can create a `KrylovWorkspace` based on the size of `A` and the type of `b`, or explicitly provide the dimensions `(m, n)` and the storage type `S`.
21
21
22
22
We assume that `S(undef, 0)`, `S(undef, n)`, and `S(undef, m)` are well-defined for the storage type `S`.
23
23
For more advanced vector types, workspaces can also be created with the help of a `KrylovConstructor`.
@@ -31,17 +31,17 @@ For example, use `S = Vector{Float64}` if you want to solve linear systems in do
31
31
The workspace is always the first argument of the in-place methods:
32
32
33
33
```@solvers
34
-
minres_solver = MinresSolver(m, n, Vector{Float64})
35
-
minres!(minres_solver, A1, b1)
34
+
minres_workspace = MinresWorkspace(m, n, Vector{Float64})
35
+
minres!(minres_workspace, A1, b1)
36
36
37
-
bicgstab_solver = BicgstabSolver(m, n, Vector{ComplexF64})
38
-
bicgstab!(bicgstab_solver, A2, b2)
37
+
bicgstab_workspace = BicgstabWorkspace(m, n, Vector{ComplexF64})
38
+
bicgstab!(bicgstab_workspace, A2, b2)
39
39
40
-
gmres_solver = GmresSolver(m, n, Vector{BigFloat})
41
-
gmres!(gmres_solver, A3, b3)
40
+
gmres_workspace = GmresWorkspace(m, n, Vector{BigFloat})
41
+
gmres!(gmres_workspace, A3, b3)
42
42
43
-
lsqr_solver = LsqrSolver(m, n, CuVector{Float32})
44
-
lsqr!(lsqr_solver, A4, b4)
43
+
lsqr_workspace = LsqrWorkspace(m, n, CuVector{Float32})
44
+
lsqr!(lsqr_workspace, A4, b4)
45
45
```
46
46
47
47
## Examples
@@ -62,18 +62,18 @@ function newton(∇f, ∇²f, x₀; itmax = 200, tol = 1e-8)
Copy file name to clipboardExpand all lines: docs/src/storage.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,8 +105,8 @@ Each table summarizes the storage requirements of Krylov methods recommended to
105
105
106
106
## Practical storage requirements
107
107
108
-
Each method has its own `KrylovSolver` that contains all the storage needed by the method.
109
-
In the REPL, the size in bytes of each attribute and the total amount of memory allocated by the solver are displayed when we show a `KrylovSolver`.
108
+
Each method has its own `KrylovWorkspace` that contains all the storage needed by the method.
109
+
In the REPL, the size in bytes of each attribute and the total amount of memory allocated by the solver are displayed when we show a `KrylovWorkspace`.
110
110
111
111
```@example storage
112
112
using Krylov
@@ -115,14 +115,14 @@ m = 5000
115
115
n = 12000
116
116
A = rand(Float64, m, n)
117
117
b = rand(Float64, m)
118
-
solver = LsmrSolver(A, b)
119
-
show(stdout, solver, show_stats=false)
118
+
workspace = LsmrWorkspace(A, b)
119
+
show(stdout, workspace, show_stats=false)
120
120
```
121
121
122
-
If we want the total number of bytes used by the solver, we can call `nbytes = sizeof(solver)`.
122
+
If we want the total number of bytes used by the workspace, we can call `nbytes = sizeof(workspace)`.
123
123
124
124
```@example storage
125
-
nbytes = sizeof(solver)
125
+
nbytes = sizeof(workspace)
126
126
```
127
127
128
128
Thereafter, we can use `Base.format_bytes(nbytes)` to recover what is displayed in the REPL.
@@ -140,7 +140,7 @@ ncoefs_lsmr = 5*n + 2*m # number of coefficients
140
140
nbytes_lsmr = sizeof(FC) * ncoefs_lsmr # number of bytes
141
141
```
142
142
143
-
Therefore, you can check that you have enough memory in RAM to allocate a `KrylovSolver`.
143
+
Therefore, you can check that you have enough memory in RAM to allocate a `KrylovWorkspace`.
0 commit comments