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
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`.
16
16
17
17
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`.
18
+
19
+
!!! note
20
+
The constructors of `CgLanczosShiftSolver` and `CglsLanczosShiftSolver` require an additional argument `nshifts`.
21
+
18
22
We assume that `S(undef, 0)`, `S(undef, n)`, and `S(undef, m)` are well-defined for the storage type `S`.
19
23
For more advanced vector types, workspaces can also be created with the help of a `KrylovConstructor`.
20
24
```@docs
@@ -24,20 +28,20 @@ See the section [custom workspaces](@ref custom_workspaces) for an example where
24
28
25
29
For example, use `S = Vector{Float64}` if you want to solve linear systems in double precision on the CPU and `S = CuVector{Float32}` if you want to solve linear systems in single precision on an Nvidia GPU.
26
30
27
-
!!! note
28
-
`DiomSolver`, `FomSolver`, `DqgmresSolver`, `GmresSolver`, `BlockGmresSolver`, `FgmresSolver`, `GpmrSolver`, `CgLanczosShiftSolver` and `CglsLanczosShiftSolver` require an additional argument (`memory` or `nshifts`).
29
-
30
31
The workspace is always the first argument of the in-place methods:
31
32
32
33
```@solvers
33
-
minres_solver = MinresSolver(n, n, Vector{Float64})
34
+
minres_solver = MinresSolver(m, n, Vector{Float64})
34
35
minres!(minres_solver, A1, b1)
35
36
36
-
dqgmres_solver = DqgmresSolver(n, n, memory, Vector{BigFloat})
37
-
dqgmres!(dqgmres_solver, A2, b2)
37
+
bicgstab_solver = BicgstabSolver(m, n, Vector{ComplexF64})
38
+
bicgstab!(bicgstab_solver, A2, b2)
39
+
40
+
gmres_solver = GmresSolver(m, n, Vector{BigFloat})
41
+
gmres!(gmres_solver, A3, b3)
38
42
39
43
lsqr_solver = LsqrSolver(m, n, CuVector{Float32})
40
-
lsqr!(lsqr_solver, A3, b3)
44
+
lsqr!(lsqr_solver, A4, b4)
41
45
```
42
46
43
47
A generic function `solve!` is also available and dispatches to the appropriate Krylov method.
@@ -46,6 +50,9 @@ A generic function `solve!` is also available and dispatches to the appropriate
46
50
Krylov.solve!
47
51
```
48
52
53
+
!!! note
54
+
The function `solve!` is not exported to prevent potential conflicts with other Julia packages.
55
+
49
56
In-place methods return an updated `solver` workspace.
50
57
Solutions and statistics can be recovered via `solver.x`, `solver.y` and `solver.stats`.
51
58
Functions `solution`, `statistics` and `results` can be also used.
0 commit comments