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_inline409 in the denominator to keep things finite for tex2html_wrap_inline411 , and (b) you shouldn't set the result at tex2html_wrap_inline411 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
Thu May 4 11:24:22 EDT 2000