Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultAlgorithmChoice.KrylovJL_LSMR is not defined #414

Closed
cvsvensson opened this issue Nov 4, 2023 · 3 comments · Fixed by #454
Closed

DefaultAlgorithmChoice.KrylovJL_LSMR is not defined #414

cvsvensson opened this issue Nov 4, 2023 · 3 comments · Fixed by #454

Comments

@cvsvensson
Copy link

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-L144C11

This code path is encountered in this MWE:

using LinearSolve
A = rand(3,2)
b = rand(3)
x = rand(2)
fo = FunctionOperator((u,p,t) -> A*u, x, b)
solve(LinearProblem(fo,b)) # UndefVarError: `KrylovJL_LSMR` not defined
@ChrisRackauckas
Copy link
Member

@avik-pal is this related to your non-square defaults? It seems like it's missing the enum

@avik-pal
Copy link
Member

avik-pal commented Nov 4, 2023

No those ones existed from before

@cvsvensson
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants