next up previous contents
Next: Implementation: K() Up: No Title Previous: Gathering data

Preconditioning

 

Yet further gains may be made by using a technique known as preconditioning. ``Preconditioning'' basically means applying an operator to your gradient in order to make the search direction point more toward the minimum. To implement this, the only changes to your code are in the formation of your search direction.

If we call the preconditioning operator K(), then the only changes you need to make appear in the code fragment below:

    if (i<10) 
      dir=(-1.)*K(grad);
    else {
      beta= ...
      dir=beta*dir+(-1.)*K(grad);
    }

The formula for tex2html_wrap_inline411 for preconditioned conjugate-gradients now becomes

displaymath419

Make these changes for preconditioning to your main() program.





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