# Diff of /trunk/escript/py_src/pdetools.py

revision 1485 by artak, Wed Apr 9 03:25:53 2008 UTC revision 1486 by artak, Thu Apr 10 00:10:50 2008 UTC
# Line 729  def MINRES(b, Aprod, Msolve, bilinearfor Line 729  def MINRES(b, Aprod, Msolve, bilinearfor
729      if beta1==0: return x*0.      if beta1==0: return x*0.
730
731      if beta1> 0:      if beta1> 0:
732        beta1  = math.sqrt(beta1)       # Normalize y to get v1 later.        beta1  = math.sqrt(beta1)
733
734      #------------------------------------------------------------------      #------------------------------------------------------------------
735      # Initialize quantities.      # Initialize quantities.
# Line 757  def MINRES(b, Aprod, Msolve, bilinearfor Line 757  def MINRES(b, Aprod, Msolve, bilinearfor
757      #---------------------------------------------------------------------      #---------------------------------------------------------------------
758      # Main iteration loop.      # Main iteration loop.
759      # --------------------------------------------------------------------      # --------------------------------------------------------------------
760      while not stoppingcriterium(rnorm,Anorm*ynorm):    #  ||r|| / (||A|| ||x||)      while not stoppingcriterium(rnorm,Anorm*ynorm):    #  checks ||r|| < (||A|| ||x||) * TOL
761
762      if iter  >= iter_max: raise MaxIterReached,"maximum number of %s steps reached."%iter_max      if iter  >= iter_max: raise MaxIterReached,"maximum number of %s steps reached."%iter_max
763          iter    = iter  +  1          iter    = iter  +  1