Skip to content
Snippets Groups Projects
Commit 7b044c50 authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

fix brown paper bag error in lapack/blas iterative refinement

parent 7592b08b
No related branches found
No related tags found
No related merge requests found
...@@ -156,7 +156,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl ...@@ -156,7 +156,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl
zaxpy_(&n, &dcone, id, &incx, arr_residual, &incy); zaxpy_(&n, &dcone, id, &incx, arr_residual, &incy);
double oldmax = 0; double oldmax = 0;
if (refinemode >0) { if (refinemode >0) {
np_int maxindex = izamax_(&n, arr_residual, &incx); np_int maxindex = izamax_(&nn, arr_residual, &incx);
#ifdef USE_MKL #ifdef USE_MKL
oldmax = cabs(arr_residual[maxindex].real + I*arr_residual[maxindex].imag); oldmax = cabs(arr_residual[maxindex].real + I*arr_residual[maxindex].imag);
#else #else
...@@ -173,7 +173,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl ...@@ -173,7 +173,7 @@ void zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxiters, doubl
zgemm_(&transa, &transa, &n, &n, &n, &dcmone, arr, &n, arr_orig, &n, &dczero, arr_residual, &n); zgemm_(&transa, &transa, &n, &n, &n, &dcmone, arr, &n, arr_orig, &n, &dczero, arr_residual, &n);
zaxpy_(&n, &dcone, id, &incx, arr_residual, &incy); zaxpy_(&n, &dcone, id, &incx, arr_residual, &incy);
if ((refinemode==2) || ((refinemode==1) && (iter == (maxiters-1)))) { if ((refinemode==2) || ((refinemode==1) && (iter == (maxiters-1)))) {
np_int maxindex = izamax_(&n, arr_residual, &incx); np_int maxindex = izamax_(&nn, arr_residual, &incx);
#ifdef USE_MKL #ifdef USE_MKL
double newmax = cabs(arr_residual[maxindex].real + I*arr_residual[maxindex].imag); double newmax = cabs(arr_residual[maxindex].real + I*arr_residual[maxindex].imag);
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment