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?
The diagonal preconditioner has a general
ldiv!method that can apply to a vector or a matrix becausebis duck typed:Preconditioners.jl/src/diagonal.jl
Line 40 in 52b3702
In contrast, the incomplete Cholesky preconditioner
ldiv!is pinned to a Vector argument:Preconditioners.jl/src/incompletecholesky.jl
Line 28 in 52b3702
Could the package provide a more general RHS? Something like:
One related hack is something like this:
but I think there should be a better way?