/[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 1787 by artak, Mon Sep 15 01:36:34 2008 UTC revision 1862 by artak, Wed Oct 8 06:30:50 2008 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /* TFQMR iterations */  /* TFQMR iterations */
16    
# Line 71  err_t Paso_Solver_MINRES( Line 72  err_t Paso_Solver_MINRES(
72      double * r,      double * r,
73      double * x,      double * x,
74      dim_t *iter,      dim_t *iter,
     double *tol,  
75      double * tolerance,      double * tolerance,
76      Paso_Performance* pp) {      Paso_Performance* pp) {
77    
# Line 170  err_t Paso_Solver_MINRES( Line 170  err_t Paso_Solver_MINRES(
170       }       }
171    
172       alfa = Paso_InnerProduct(n,v,y,A->mpi_info);       alfa = Paso_InnerProduct(n,v,y,A->mpi_info);
173       Paso_Update(n, 1., y, -(alfa/beta), r2);       Paso_Update(n, 1., y, (-alfa/beta), r2);
174       Paso_Copy(n,r1,r2);       Paso_Copy(n,r1,r2);
175       Paso_Copy(n,r2,y);       Paso_Copy(n,r2,y);
176    
# Line 236  err_t Paso_Solver_MINRES( Line 236  err_t Paso_Solver_MINRES(
236       rnorm  = phibar;       rnorm  = phibar;
237    
238       maxIterFlag = (num_iter > maxit);       maxIterFlag = (num_iter > maxit);
239       norm_of_residual=rnorm;       norm_of_residual=rnorm/Anorm*ynorm;
240       convergeFlag=(norm_of_residual<Anorm*ynorm*(*tolerance));       convergeFlag=(norm_of_residual<(*tolerance));
241            
242            
243       if (maxIterFlag) {       if (maxIterFlag) {
# Line 246  err_t Paso_Solver_MINRES( Line 246  err_t Paso_Solver_MINRES(
246           status = SOLVER_BREAKDOWN;           status = SOLVER_BREAKDOWN;
247       }       }
248      ++(num_iter);      ++(num_iter);
     /*printf("residual norm %.10f < %.10f %.10f %.10f \n",rnorm,Anorm*ynorm*(*tolerance), Anorm*ynorm, (*tolerance));*/  
249    }    }
250      /* end of iteration */      /* end of iteration */
251            
# Line 260  err_t Paso_Solver_MINRES( Line 259  err_t Paso_Solver_MINRES(
259      TMPMEMFREE(v);      TMPMEMFREE(v);
260        
261      *iter=num_iter;      *iter=num_iter;
262      *tol=norm_of_residual;      *tolerance=norm_of_residual;
263            
264    /*     End of MINRES */    /*     End of MINRES */
265    return status;    return status;

Legend:
Removed from v.1787  
changed lines
  Added in v.1862

  ViewVC Help
Powered by ViewVC 1.1.26