mcovalt / ConjugateGradients.jl

Flexible, non-allocating Julia implementations of the CG and BiCGStab methods.
MIT License
10 stars 2 forks source link

Example with a Pre Conditioner #2

Open RoyiAvital opened 3 months ago

RoyiAvital commented 3 months ago

Hi,

Could you add information about the Preconditioner format.

If one use the Wikipeida convention (The Preconditioned Conjugate Gradient Method) , do you require $\boldsymbol{M}$ or $\boldsymbol{M}^{-1}$?

RoyiAvital commented 3 months ago

Looking at the code:

https://github.com/mcovalt/ConjugateGradients.jl/blob/12a23dd7d43177a15bb75508312386d43eed6108/src/cg.jl#L28

I assume you need a solver. Namely the function should return the solution to $\boldsymbol{M} \boldsymbol{z} = \boldsymbol{r}$.