Changeset 8025
 Timestamp:
 Sep 23, 2010, 12:21:55 PM (8 years ago)
 Location:
 trunk/anuga_core/source/anuga/utilities
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/utilities/cg_solve.py
r7848 r8025 8 8 9 9 10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e8, iprint=None):10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e8,atol=1.0e14,iprint=None): 11 11 """ 12 12 Try to solve linear equation Ax = b using … … 27 27 for i in range(b.shape[1]): 28 28 x0[:,i] = _conjugate_gradient(A, b[:,i], x0[:,i], 29 imax, tol, iprint)29 imax, tol, atol, iprint) 30 30 else: 31 x0 = _conjugate_gradient(A, b, x0, imax, tol, iprint)31 x0 = _conjugate_gradient(A, b, x0, imax, tol, atol, iprint) 32 32 33 33 return x0 34 34 35 def _conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e8,iprint=None): 35 def _conjugate_gradient(A, b, x0, 36 imax=10000, tol=1.0e8, atol=1.0e14, iprint=None): 36 37 """ 37 38 Try to solve linear equation Ax = b using … … 73 74 74 75 #FIXME Let the iterations stop if starting with a small residual 75 while (i<imax and rTr>tol**2*rTr0 ):76 while (i<imax and rTr>tol**2*rTr0 and rTr>atol**2 ): 76 77 q = A*d 77 78 alpha = rTr/num.dot(d,q) 
trunk/anuga_core/source/anuga/utilities/polygon_ext.c
r8017 r8025 102 102 // be unmodified. 103 103 104 int __line SegmentIntersection(104 int __line_segment_intersection( 105 105 double Ax, double Ay, 106 106 double Bx, double By,
Note: See TracChangeset
for help on using the changeset viewer.