JuliaLinearAlgebra / Preconditioners.jl

A few preconditioners for iterative solvers.
https://julialinearalgebra.github.io/Preconditioners.jl/
Other
50 stars 11 forks source link

Enable the use of functions as preconditioners #11

Open mohamed82008 opened 4 years ago

mohamed82008 commented 4 years ago

Often the preconditioner can be defined as a function instead of a type with ldiv! method. For example, see https://github.com/JuliaMath/IterativeSolvers.jl/issues/258. It would be nice to be able to wrap the function in a type PreconditionerFunction and pass that to iterative solvers seamlessly.

bodhi91 commented 4 years ago

Is there a PreconditionerFunction for use? I have coded a multigrid preconditioner which returns a function accepting a vector as its argument. I aim to pass this function to the lobpcg. I was wondering if I have to write my own wrapper trying to overload ldiv! or if there is an existing PreconditionerFunction ready for use?

JeffFessler commented 1 year ago

Assuming a preconditioner is a linear mapping, how about using LinearMaps.jl instead of a function?