| |
| | First conjugate-gradient program |
 | | The conjugate-gradient program can be divided into two parts: an inner part that is used almost without change over a wide variety of applications, and an outer part containing the initializations. |
 | | # setup of conjugate gradient descent, minimize SUM rr(i)**2 # nx # rr(i) = yy(i) - sum aaa(i,j) * x(j) # j=1 subroutine cgmeth(nx,x, nr,yy,rr, aaa, niter) integer i, iter, nx, nr, niter real x(nx), yy(nr), rr(nr), aaa(nr,nx) temporary real dx(nx), sx(nx), dr(nr), sr(nr) do i= 1, nx x(i) = 0. |
 | | Then it loops over iterations, invoking matrix multiply, conjugate transpose multiply, and the conjugate-gradient stepper. |
| sepwww.stanford.edu /sep/prof/pvi/ls/paper_html/node16.html (344 words) |
|