next up previous contents
Next: Debugging and Gathering data Up: Preconditioning Previous: Preconditioning

Implementation: K()

  friend pvector K(const pvector& in1)

Return value:

Input:

To implement preconditioning, add a function of the above prototype to the definition of the pvector class.

You may model K() on the Linv function. The only differences between Linv() and K() are that, now, (a) 1. is added to tex2html_wrap_inline423 in the denominator to keep things finite for tex2html_wrap_inline425 , and (b) you shouldn't set the result at tex2html_wrap_inline425 to zero.

Hint if you run into trouble: a good test for debugging is that if you just have K() return in1, then you should recover your original conjugate-gradient results.



Tomas Arias
Mon Apr 15 14:09:23 EDT 2002