Skip to main content
. Author manuscript; available in PMC: 2020 Oct 1.
Published in final edited form as: Med Image Anal. 2019 Jun 22;57:44–55. doi: 10.1016/j.media.2019.06.010

Algorithm 1.

Conjugate Gradient Method

Require: Matrix M, vector v and initialization dHR(0).
1: Let r0=vMdHR(0), p0 = r0 and k = 0
2: loop
3: αk=rkrkpkMpk
4: dHR(k+1)=dHR(k)+αkpk
5: rk+1 = rkαkMpk
6: if rk+1dHR(0)<tol then
7:   end loop
8: end if
9: βk=rk+1rk+1rkrk
10: pk+1 = rk+1 + βkpk
11: k = k +1
12: end loop
13: return dHR(k+1)