From 41d7626b66d97657fc740447429325df5ed7c2b1 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Fri, 21 Apr 2006 14:05:47 +0000 Subject: [PATCH] First version of complex SuperLU preconditioners. --- src/prec/psb_slu_impl.c | 12 ++++++------ src/prec/psb_zslu_bld.f90 | 2 +- src/prec/psb_zslu_impl.c | 17 ++++++++--------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/prec/psb_slu_impl.c b/src/prec/psb_slu_impl.c index e93f7101..956bfe37 100644 --- a/src/prec/psb_slu_impl.c +++ b/src/prec/psb_slu_impl.c @@ -131,7 +131,7 @@ typedef struct { void psb_dslu_factor_(int *n, int *nnz, - double *values, int *rowind, int *colptr, + double *values, int *rowptr, int *colind, #ifdef Have_SLU_ fptr *f_factors, /* a handle containing the address pointing to the factored matrices */ @@ -177,10 +177,10 @@ psb_dslu_factor_(int *n, int *nnz, StatInit(&stat); /* Adjust to 0-based indexing */ - for (i = 0; i < *nnz; ++i) --colptr[i]; - for (i = 0; i <= *n; ++i) --rowind[i]; + for (i = 0; i < *nnz; ++i) --colind[i]; + for (i = 0; i <= *n; ++i) --rowptr[i]; - dCreate_CompRow_Matrix(&A, *n, *n, *nnz, values, colptr, rowind, + dCreate_CompRow_Matrix(&A, *n, *n, *nnz, values, colind, rowptr, SLU_NR, SLU_D, SLU_GE); L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); @@ -230,8 +230,8 @@ psb_dslu_factor_(int *n, int *nnz, } /* Restore to 1-based indexing */ - for (i = 0; i < *nnz; ++i) ++colptr[i]; - for (i = 0; i <= *n; ++i) ++rowind[i]; + for (i = 0; i < *nnz; ++i) ++colind[i]; + for (i = 0; i <= *n; ++i) ++rowptr[i]; /* Save the LU factors in the factors handle */ LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); diff --git a/src/prec/psb_zslu_bld.f90 b/src/prec/psb_zslu_bld.f90 index 40afde5b..28339157 100644 --- a/src/prec/psb_zslu_bld.f90 +++ b/src/prec/psb_zslu_bld.f90 @@ -177,7 +177,7 @@ subroutine psb_zslu_bld(a,desc_a,p,info) endif call psb_zslu_factor(atmp%m,nzt,& - & atmp%aspk,atmp%ia2,atmp%ia1,p%iprcparm(slu_ptr_),info) + & atmp%aspk,atmp%ia1,atmp%ia2,p%iprcparm(slu_ptr_),info) if(info /= 0) then info=4010 ch_err='psb_slu_fact' diff --git a/src/prec/psb_zslu_impl.c b/src/prec/psb_zslu_impl.c index c8dd1e35..597afae1 100644 --- a/src/prec/psb_zslu_impl.c +++ b/src/prec/psb_zslu_impl.c @@ -85,7 +85,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef Have_SLU_ #include "zsp_defs.h" -#undef Have_SLU_ #define HANDLE_SIZE 8 /* kind of integer to hold a pointer. Use int. This might need to be changed on 64-bit systems. */ @@ -132,11 +131,11 @@ typedef struct { void psb_zslu_factor_(int *n, int *nnz, #ifdef Have_SLU_ - doublecomplex *values, int *rowind, int *colptr, + doublecomplex *values, int *colind, int *rowptr, fptr *f_factors, /* a handle containing the address pointing to the factored matrices */ #else - void *values, int *rowind, int *colptr, + void *values, int *colind, int *rowptr, void *f_factors, #endif int *info) @@ -178,11 +177,11 @@ psb_zslu_factor_(int *n, int *nnz, StatInit(&stat); /* Adjust to 0-based indexing */ - for (i = 0; i < *nnz; ++i) --colptr[i]; - for (i = 0; i <= *n; ++i) --rowind[i]; + for (i = 0; i < *nnz; ++i) --colind[i]; + for (i = 0; i <= *n; ++i) --rowptr[i]; - zCreate_CompRow_Matrix(&A, *n, *n, *nnz, values, colptr, rowind, - SLU_NC, SLU_Z, SLU_GE); + zCreate_CompRow_Matrix(&A, *n, *n, *nnz, values, colind, rowptr, + SLU_NR, SLU_Z, SLU_GE); L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); @@ -231,8 +230,8 @@ psb_zslu_factor_(int *n, int *nnz, } /* Restore to 1-based indexing */ - for (i = 0; i < *nnz; ++i) ++colptr[i]; - for (i = 0; i <= *n; ++i) ++rowind[i]; + for (i = 0; i < *nnz; ++i) ++colind[i]; + for (i = 0; i <= *n; ++i) ++rowptr[i]; /* Save the LU factors in the factors handle */ LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t));