Closed cvsvensson closed 8 months ago
@avik-pal is this related to your non-square defaults? It seems like it's missing the enum
No those ones existed from before
Here's some more info. If size(A) == (2,3) instead, the same error occurs for KrylovJL_CRAIGMR. There is no problem if one supplies the algorithm explicitly to solve().
using LinearSolve
m, n = 3, 2 # Swap dimensions to get an error for KrylovJL_CRAIGMR instead
A = rand(m, n)
b = rand(m)
x = rand(n)
f = (du, u, p, t) -> mul!(du, A, u)
fadj = (du, u, p, t) -> mul!(du, A', u)
fo = FunctionOperator(f, x, b; op_adjoint = fadj)
prob = LinearProblem(fo, b)
solve(prob) # UndefVarError: `KrylovJL_LSMR` not defined
solve(prob, LinearSolve.KrylovJL_LSMR()) # This works
I tried simply adding KrylovJL_LSMR to the enum and a few other places, but the code execution ended up in gmres!, so I don't understand how the dispatch works.
DefaultAlgorithmChoice.KrylovJL_LSMR
is used in the linked code, but it does not exist. https://github.com/SciML/LinearSolve.jl/blob/d863895dbf4eeb153f8deae331c7e4e0b74dc68a/src/default.jl#L144C11-L144C11This code path is encountered in this MWE: