/[escript]/trunk/paso/src/MINRES.c
ViewVC logotype

Diff of /trunk/paso/src/MINRES.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2565 by artak, Tue Jul 28 05:50:15 2009 UTC revision 2826 by artak, Fri Dec 18 01:33:35 2009 UTC
# Line 135  err_t Paso_Solver_MINRES( Line 135  err_t Paso_Solver_MINRES(
135    Paso_zeroes(n,w);    Paso_zeroes(n,w);
136    Paso_zeroes(n,w2);    Paso_zeroes(n,w2);
137        
138        Paso_zeroes(n,x);
139      
140    Paso_Copy(n,r2,r1);    Paso_Copy(n,r2,r1);
141        
142    Anorm = 0;    Anorm = 0;
# Line 153  err_t Paso_Solver_MINRES( Line 155  err_t Paso_Solver_MINRES(
155    sn     = 0;    sn     = 0;
156    eps    = 0.000001;    eps    = 0.000001;
157    
158    while (!(convergeFlag || maxIterFlag || breakFlag || (status !=SOLVER_NO_ERROR) ))    while (!(convergeFlag || (status !=SOLVER_NO_ERROR) ))
159    {    {
160                        
161       s=1/beta;       s=1/beta;
# Line 238  err_t Paso_Solver_MINRES( Line 240  err_t Paso_Solver_MINRES(
240    
241       rnorm  = phibar;       rnorm  = phibar;
242       epsx   = Anorm*ynorm*eps;       epsx   = Anorm*ynorm*eps;
243        
244       maxIterFlag = (num_iter > maxit);      
245       norm_of_residual=rnorm;       if (status==SOLVER_NO_ERROR) {  
246       convergeFlag=((norm_of_residual/(Anorm*ynorm))<(*tolerance) || 1+(norm_of_residual/(Anorm*ynorm)) <=1);          maxIterFlag = (num_iter > maxit);
247                norm_of_residual=rnorm;
248       if (maxIterFlag) {          convergeFlag=((norm_of_residual/(Anorm*ynorm))<(*tolerance) || 1+(norm_of_residual/(Anorm*ynorm)) <=1);
249           status = SOLVER_MAXITER_REACHED;          if (maxIterFlag) {
250       } else if (breakFlag) {              status = SOLVER_MAXITER_REACHED;
251           status = SOLVER_BREAKDOWN;          } else if (breakFlag) {
252                status = SOLVER_BREAKDOWN;
253            }
254       }       }
255      ++(num_iter);      ++(num_iter);
256    }    }

Legend:
Removed from v.2565  
changed lines
  Added in v.2826

  ViewVC Help
Powered by ViewVC 1.1.26