|
27 | 27 | export krylov_workspace, krylov_solve, krylov_solve! |
28 | 28 |
|
29 | 29 | """ |
| 30 | + workspace = krylov_workspace(method, args...; kwargs...) |
30 | 31 | workspace = krylov_workspace(Val(method), args...; kwargs...) |
31 | 32 |
|
32 | 33 | Generic function that dispatches to the appropriate workspace constructor for each subtype of [`KrylovWorkspace`](@ref) and [`BlockKrylovWorkspace`](@ref). |
33 | | -The first argument `Val(method)`, where `method` is a symbol (such as `:cg`, `:gmres` or `:block_minres`), specifies the (block) Krylov method for which a workspace is desired. |
| 34 | +In both calls, `method` is a symbol (such as `:cg`, `:gmres` or `:block_minres`) that specifies the (block) Krylov method for which a workspace is desired. |
34 | 35 | The returned workspace can later be used by [`krylov_solve!`](@ref) to execute the (block) Krylov method in-place. |
| 36 | +
|
| 37 | +Pass the plain symbol `method` for convenience, or wrap it in `Val(method)` to enable full compile-time specialization, improve type inference, and achieve maximum performance. |
35 | 38 | """ |
36 | 39 | function krylov_workspace end |
37 | 40 |
|
| 41 | +krylov_workspace(method::Symbol, args...; kwargs...) = krylov_workspace(Val(method), args...; kwargs...) |
| 42 | + |
38 | 43 | """ |
| 44 | + krylov_solve(method, args...; kwargs...) |
39 | 45 | krylov_solve(Val(method), args...; kwargs...) |
40 | 46 |
|
41 | | -Generic function that dispatches to the appropriate out-of-place (block) Krylov method specified by symbol `method` (such as `:cg`, `:gmres` or `:block_minres`). |
| 47 | +Generic function that dispatches to the appropriate out-of-place (block) Krylov method specified by `method`. |
| 48 | +In both calls, `method` is a symbol (such as `:cg`, `:gmres` or `:block_minres`). |
| 49 | +
|
| 50 | +Pass the plain symbol `method` for convenience, or wrap it in `Val(method)` to enable full compile-time specialization, improve type inference, and achieve maximum performance. |
42 | 51 | """ |
43 | 52 | function krylov_solve end |
44 | 53 |
|
| 54 | +krylov_solve(method::Symbol, args...; kwargs...) = krylov_solve(Val(method), args...; kwargs...) |
| 55 | + |
45 | 56 | """ |
46 | 57 | krylov_solve!(workspace, args...; kwargs...) |
47 | 58 |
|
|
0 commit comments