# Preconditioner implementation

1. Aug 13, 2009

### confi999

I need to solve Ax=b with preconditioner where A is large and sparse square (nxn) matrix. I have readily available 'bicgstab' routine (in fortran) with which I can solve Ax=b. I want to use preconditioner with bicgstab to improve the convergence speed.

My main project is in fortran but in matlab I have tested that if M (a certain matrix obtained from A) is the preconditoner for matlab function bicgstab it gives some improvement. Matlab documents say it implements: M^{inverse} A x = M^{inverse} b if M is passed as a preconditioner. So back to actual fortran implementation I have matrix M but (following matlab documentation) the precontioner would be M^{inverse}. Now I am having difficulty in getting and including this M^{inverse} part in the fortran solver. I understand it is not wise to do the actual inversion. What I have tried is

a) z = M^{inverse} b
Mz=b and solve for z
b) get y=Mz
c) solve Ax=y for x

Not sure if it is the (best) way to include the preconditioner. Or this way (a,b,c above) actually affects the solution as M^{inverse} A x = M^{inverse} b should do?

Am I correct in my above understanding? My background is not math - it is an engineering project. Can someone advise me how I will implement M^{inverse} in fortran solver. Thank you