Changeset 7848 for trunk/anuga_core/source/anuga/utilities/cg_solve.py
- Timestamp:
- Jun 16, 2010, 2:50:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/utilities/cg_solve.py
r7845 r7848 8 8 9 9 10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint= 0):10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint=None): 11 11 """ 12 12 Try to solve linear equation Ax = b using … … 33 33 return x0 34 34 35 def _conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint= 0):35 def _conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint=None): 36 36 """ 37 37 Try to solve linear equation Ax = b using … … 62 62 63 63 #FIXME: Should test using None 64 if iprint == 0:64 if iprint == None or iprint == 0: 65 65 iprint = imax 66 66 … … 72 72 rTr0 = rTr 73 73 74 #FIXME Let the iterations stop if starting with a small residual 74 75 while (i<imax and rTr>tol**2*rTr0): 75 76 q = A*d
Note: See TracChangeset
for help on using the changeset viewer.