/[escript]/branches/doubleplusgood/paso/src/TFQMR.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/paso/src/TFQMR.cpp

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

trunk/paso/src/TFQMR.c revision 4093 by gross, Fri Nov 30 04:52:01 2012 UTC branches/doubleplusgood/paso/src/TFQMR.cpp revision 4275 by jfenwick, Tue Mar 5 09:32:52 2013 UTC
# Line 1  Line 1 
1    
2  /*****************************************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2012 by University of Queensland  * Copyright (c) 2003-2013 by University of Queensland
5  * http://www.uq.edu.au  * http://www.uq.edu.au
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
# Line 99  err_t Paso_Solver_TFQMR( Line 99  err_t Paso_Solver_TFQMR(
99  /*   ---------------------                                         */  /*   ---------------------                                         */
100  /*                                                                 */  /*                                                                 */
101  /*                                                                 */  /*                                                                 */
102    u1=TMPMEMALLOC(n,double);    u1=new double[n];
103    u2=TMPMEMALLOC(n,double);    u2=new double[n];
104    y1=TMPMEMALLOC(n,double);    y1=new double[n];
105    y2=TMPMEMALLOC(n,double);    y2=new double[n];
106    d=TMPMEMALLOC(n,double);    d=new double[n];
107    w=TMPMEMALLOC(n,double);    w=new double[n];
108    v=TMPMEMALLOC(n,double);    v=new double[n];
109    temp_vector=TMPMEMALLOC(n,double);    temp_vector=new double[n];
110    res=TMPMEMALLOC(n,double);    res=new double[n];
111    
112   if (u1 ==NULL || u2== NULL || y1 == NULL || y2== NULL || d==NULL || w==NULL || v==NULL ) {   if (u1 ==NULL || u2== NULL || y1 == NULL || y2== NULL || d==NULL || w==NULL || v==NULL ) {
113       status=SOLVER_MEMORY_ERROR;       status=SOLVER_MEMORY_ERROR;
# Line 201  err_t Paso_Solver_TFQMR( Line 201  err_t Paso_Solver_TFQMR(
201            }            }
202                    
203           theta =Paso_l2(n,w,A->mpi_info)/tau;           theta =Paso_l2(n,w,A->mpi_info)/tau;
204       printf("tau = %e, %e %e\n",tau, Paso_l2(n,w,A->mpi_info)/tau, theta);           /*printf("tau = %e, %e %e\n",tau, Paso_l2(n,w,A->mpi_info)/tau, theta);*/
205           c = PASO_ONE / sqrt ( PASO_ONE + theta * theta );           c = PASO_ONE / sqrt ( PASO_ONE + theta * theta );
206           tau = tau * theta * c;           tau = tau * theta * c;
207           eta = c * c * alpha;           eta = c * c * alpha;
# Line 245  err_t Paso_Solver_TFQMR( Line 245  err_t Paso_Solver_TFQMR(
245      /* end of iteration */      /* end of iteration */
246            
247      Performance_stopMonitor(pp,PERFORMANCE_SOLVER);      Performance_stopMonitor(pp,PERFORMANCE_SOLVER);
248      TMPMEMFREE(u1);      delete[] (u1);
249      TMPMEMFREE(u2);      delete[] (u2);
250      TMPMEMFREE(y1);      delete[] (y1);
251      TMPMEMFREE(y2);      delete[] (y2);
252      TMPMEMFREE(d);      delete[] (d);
253      TMPMEMFREE(w);      delete[] (w);
254      TMPMEMFREE(v);      delete[] (v);
255      TMPMEMFREE(temp_vector);      delete[] (temp_vector);
256      TMPMEMFREE(res);      delete[] (res);
257      *iter=num_iter;      *iter=num_iter;
258      *tolerance=norm_of_residual;      *tolerance=norm_of_residual;
259            

Legend:
Removed from v.4093  
changed lines
  Added in v.4275

  ViewVC Help
Powered by ViewVC 1.1.26