Commit 4fb852ad authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

add some verbosity to iterative refinement

parent 7ff38402
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl
#else
      oldmax = cabs(arr_residual[maxindex]);
#endif
      printf("Initial max residue = %g\n", oldmax);
      if (oldmax < accuracygoal) iteraterefine = false;
    }
    int iter;
@@ -178,6 +179,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl
#else
	double newmax = cabs(arr_residual[maxindex]);
#endif
	printf("Max residue after %d iterations = %g\n", iter+1, newmax);
	if ((refinemode==2) && ((newmax > oldmax)||(newmax < accuracygoal))) iteraterefine = false;
	oldmax = newmax; 
      }
+2 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ void magma_zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters,
      magma_zgetvector(1, d_a_residual+maxindex, 1, &magmamax, 1, queue);
      // take the module
      oldmax = cabs(magmamax.x + I*magmamax.y);
      printf("Initial max residue = %g\n", oldmax);
      if (oldmax < accuracygoal) iteraterefine = false;
    }
    // begin correction loop (should iterate maxiters times)
@@ -192,6 +193,7 @@ void magma_zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters,
	magma_zgetvector(1, d_a_residual+maxindex, 1, &magmamax, 1, queue);
	// take the module
	double newmax = cabs(magmamax.x + I*magmamax.y);
	printf("Max residue after %d iterations = %g\n", iter+1, newmax);
	// if the maximum in the residual decreased from the previous iteration,
	// update oldmax and go on, otherwise no point further iterating refinements
	if ((refinemode==2) && ((newmax > oldmax)||(newmax < accuracygoal))) iteraterefine = false;