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

More general \ and ldiv! for incomplete Cholesky #33

Open
JeffFessler opened this issue Nov 7, 2022 · 1 comment
Open

More general \ and ldiv! for incomplete Cholesky #33

JeffFessler opened this issue Nov 7, 2022 · 1 comment

Comments

@JeffFessler
Copy link
Member

The diagonal preconditioner has a general ldiv! method that can apply to a vector or a matrix because b is duck typed:

ldiv!(C::DiagonalPreconditioner, b) = ldiv!(b, C, b)

In contrast, the incomplete Cholesky preconditioner ldiv! is pinned to a Vector argument:

@inline function ldiv!(y::AbstractVector, C::CholeskyPreconditioner, b::AbstractVector)

Could the package provide a more general RHS? Something like:

@inline function ldiv!(y::AbstractVecOrMat, C::CholeskyPreconditioner, b::AbstractVecOrMat)

One related hack is something like this:

import Base.\
\(C::CholeskyPreconditioner, A::AbstractMatrix) = reduce(hcat, [C \ c for c in eachcol(A)])

but I think there should be a better way?

@mohamed82008
Copy link
Member

We will need to upstream these implementations to the dependency packages first if possible. If the maintainers are not receptive, we can roll our own implementation here.

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

No branches or pull requests

2 participants