Commit 53fcf8f
authored
Stop cg_lanczos! resolving to the shifted workspace (#1251)
`get_KrylovJL_solver` tested `KrylovAlg === Krylov.cg_lanczos!` twice. The
first branch returned `CgLanczosShiftWorkspace`, so it won, and the second
branch returning `CgLanczosWorkspace` was unreachable.
`cg_lanczos!` is listed in the `KrylovJL` docstring as a supported
`KrylovAlg`, so this is reachable from documented usage:
solve(LinearProblem(A, b), KrylovJL(KrylovAlg = Krylov.cg_lanczos!))
MethodError: no method matching CgLanczosShiftWorkspace(::Matrix{Float64}, ::Vector{Float64})
Dropping the first branch lets it fall through to the right workspace. The
solve then succeeds, to a relative error of 5.9e-9 on a symmetric positive
definite system.
`cg_lanczos_shift!` and `cgls_lanczos_shift!` are deliberately left
unmapped. Both exist in Krylov 0.10, but they take a `shifts` argument that
this wrapper never passes, and neither appears in the docstring's list, so
they keep hitting "Invalid Krylov method detected" rather than being
advertised and broken.
Spotted in #554, which is otherwise superseded: block GMRES and MINRES are
already interfaced through `BlockGmresWorkspace` and `BlockMinresWorkspace`
for a matrix right-hand side.1 parent 7d64eae commit 53fcf8f
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
0 commit comments