diff --git a/CMakeLists.txt b/CMakeLists.txt index 343a6811393f77c68ebcf37228a0937908180faf..b0d102d7705f83f0ed74f5e14afab802428b6b2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ set(SOURCES set(spm_headers ${generated_headers} - csc.h + spm.h ) ### Generate the sources in all precisions @@ -35,15 +35,15 @@ precisions_rules_py(generated_sources set(spm_sources ${generated_sources} - csc.c - csc_io.c + spm.c + spm_io.c ) add_custom_target(spm_headers_tgt DEPENDS ${spm_headers} ) set_source_files_properties( - spm/csc.c + spm/spm.c PROPERTIES DEPENDS spm_headers_tgt ) diff --git a/csc.c b/spm.c similarity index 87% rename from csc.c rename to spm.c index 763c6dda3c171961c3fd5eb74a1ae20a33ee712d..112a33a663112571b392aa027fd66d69763616fd 100644 --- a/csc.c +++ b/spm.c @@ -1,8 +1,8 @@ /** * - * @file csc.c + * @file spm.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,7 +14,7 @@ * **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" #include "c_spm.h" @@ -22,7 +22,7 @@ #include "s_spm.h" #include "p_spm.h" -static int (*conversionTable[3][3][6])(pastix_csc_t*) = { +static int (*conversionTable[3][3][6])(pastix_spm_t*) = { /* From CSC */ {{ NULL, NULL, NULL, NULL, NULL, NULL }, { p_spmConvertCSC2CSR, @@ -94,7 +94,7 @@ static int (*conversionTable[3][3][6])(pastix_csc_t*) = { * *******************************************************************************/ int -spmConvert( int ofmttype, pastix_csc_t *ospm ) +spmConvert( int ofmttype, pastix_spm_t *ospm ) { if ( conversionTable[ospm->fmttype][ofmttype][ospm->flttype] ) { return conversionTable[ospm->fmttype][ofmttype][ospm->flttype]( ospm ); @@ -122,7 +122,7 @@ spmConvert( int ofmttype, pastix_csc_t *ospm ) * *******************************************************************************/ pastix_int_t -spmFindBase( const pastix_csc_t *spm ) +spmFindBase( const pastix_spm_t *spm ) { pastix_int_t i, *tmp, baseval; @@ -192,24 +192,24 @@ spmFindBase( const pastix_csc_t *spm ) *******************************************************************************/ double spmNorm( int ntype, - const pastix_csc_t *csc ) + const pastix_spm_t *spm ) { double tmp; - switch (csc->flttype) { + switch (spm->flttype) { case PastixFloat: - tmp = (double)s_spmNorm( ntype, csc ); + tmp = (double)s_spmNorm( ntype, spm ); return tmp; case PastixDouble: - return d_spmNorm( ntype, csc ); + return d_spmNorm( ntype, spm ); case PastixComplex32: - tmp = (double)c_spmNorm( ntype, csc ); + tmp = (double)c_spmNorm( ntype, spm ); return tmp; case PastixComplex64: - return z_spmNorm( ntype, csc ); + return z_spmNorm( ntype, spm ); default: return -1.; @@ -242,23 +242,23 @@ spmNorm( int ntype, * *******************************************************************************/ int -spmSort( pastix_csc_t *csc ) +spmSort( pastix_spm_t *spm ) { - switch (csc->flttype) { + switch (spm->flttype) { case PastixPattern: - p_spmSort( csc ); + p_spmSort( spm ); break; case PastixFloat: - s_spmSort( csc ); + s_spmSort( spm ); break; case PastixDouble: - d_spmSort( csc ); + d_spmSort( spm ); break; case PastixComplex32: - c_spmSort( csc ); + c_spmSort( spm ); break; case PastixComplex64: - z_spmSort( csc ); + z_spmSort( spm ); break; default: return PASTIX_ERR_BADPARAMETER; @@ -292,23 +292,23 @@ spmSort( pastix_csc_t *csc ) * *******************************************************************************/ pastix_int_t -spmMergeDuplicate( pastix_csc_t *csc ) +spmMergeDuplicate( pastix_spm_t *spm ) { - switch (csc->flttype) { + switch (spm->flttype) { case PastixPattern: - return p_spmMergeDuplicate( csc ); + return p_spmMergeDuplicate( spm ); case PastixFloat: - return s_spmMergeDuplicate( csc ); + return s_spmMergeDuplicate( spm ); case PastixDouble: - return d_spmMergeDuplicate( csc ); + return d_spmMergeDuplicate( spm ); case PastixComplex32: - return c_spmMergeDuplicate( csc ); + return c_spmMergeDuplicate( spm ); case PastixComplex64: - return z_spmMergeDuplicate( csc ); + return z_spmMergeDuplicate( spm ); default: return PASTIX_ERR_BADPARAMETER; @@ -341,23 +341,23 @@ spmMergeDuplicate( pastix_csc_t *csc ) * *******************************************************************************/ pastix_int_t -spmSymmetrize( pastix_csc_t *csc ) +spmSymmetrize( pastix_spm_t *spm ) { - switch (csc->flttype) { + switch (spm->flttype) { case PastixPattern: - return p_spmSymmetrize( csc ); + return p_spmSymmetrize( spm ); case PastixFloat: - return s_spmSymmetrize( csc ); + return s_spmSymmetrize( spm ); case PastixDouble: - return d_spmSymmetrize( csc ); + return d_spmSymmetrize( spm ); case PastixComplex32: - return c_spmSymmetrize( csc ); + return c_spmSymmetrize( spm ); case PastixComplex64: - return z_spmSymmetrize( csc ); + return z_spmSymmetrize( spm ); default: return PASTIX_ERR_BADPARAMETER; @@ -396,23 +396,23 @@ spmSymmetrize( pastix_csc_t *csc ) * pointer. * *******************************************************************************/ -pastix_csc_t * -spmCheckAndCorrect( pastix_csc_t *csc ) +pastix_spm_t * +spmCheckAndCorrect( pastix_spm_t *spm ) { - pastix_csc_t *newcsc = NULL; + pastix_spm_t *newspm = NULL; pastix_int_t count; /* Let's work on a copy */ - newcsc = spmCopy( csc ); + newspm = spmCopy( spm ); /* PaStiX works on CSC matrices */ - spmConvert( PastixCSC, newcsc ); + spmConvert( PastixCSC, newspm ); /* Sort the rowptr for each column */ - spmSort( newcsc ); + spmSort( newspm ); /* Merge the duplicated entries by summing the values */ - count = spmMergeDuplicate( newcsc ); + count = spmMergeDuplicate( newspm ); if ( count > 0 ) { fprintf(stderr, "spmCheckAndCorrect: %ld entries have been merged\n", (int64_t)count ); } @@ -422,29 +422,29 @@ spmCheckAndCorrect( pastix_csc_t *csc ) * part, otherwise, we symmetrize the graph to get A+A^t, new values are set * to 0. */ - if ( newcsc->mtxtype == PastixGeneral ) { - count = spmSymmetrize( newcsc ); + if ( newspm->mtxtype == PastixGeneral ) { + count = spmSymmetrize( newspm ); if ( count > 0 ) { fprintf(stderr, "spmCheckAndCorrect: %ld entries have been added for symmetry\n", (int64_t)count ); } } else { - //spmToLower( newcsc ); + //spmToLower( newspm ); } /** * Check if we return the new one, or the original one because no changes * have been made */ - if (( csc->fmttype != newcsc->fmttype ) || - ( csc->nnz != newcsc->nnz ) ) + if (( spm->fmttype != newspm->fmttype ) || + ( spm->nnz != newspm->nnz ) ) { - return newcsc; + return newspm; } else { - spmExit( newcsc ); - free(newcsc); - return (pastix_csc_t*)csc; + spmExit( newspm ); + free(newspm); + return (pastix_spm_t*)spm; } } @@ -462,7 +462,7 @@ spmCheckAndCorrect( pastix_csc_t *csc ) * *******************************************************************************/ void -spmExit( pastix_csc_t *spm ) +spmExit( pastix_spm_t *spm ) { if(spm->colptr != NULL) memFree_null(spm->colptr); @@ -492,12 +492,12 @@ spmExit( pastix_csc_t *spm ) * The copy of the sparse matrix. * *******************************************************************************/ -pastix_csc_t * -spmCopy( const pastix_csc_t *spm ) +pastix_spm_t * +spmCopy( const pastix_spm_t *spm ) { - pastix_csc_t *newspm = (pastix_csc_t*)malloc(sizeof(pastix_csc_t)); + pastix_spm_t *newspm = (pastix_spm_t*)malloc(sizeof(pastix_spm_t)); - memcpy( newspm, spm, sizeof(pastix_csc_t)); + memcpy( newspm, spm, sizeof(pastix_spm_t)); if(spm->colptr != NULL) { newspm->colptr = (pastix_int_t*)malloc((spm->n+1) * sizeof(pastix_int_t)); @@ -535,7 +535,7 @@ spmCopy( const pastix_csc_t *spm ) * The base value to use in the graph (0 or 1). * *******************************************************************************/ -void spmBase( pastix_csc_t *spm, +void spmBase( pastix_spm_t *spm, int baseval ) { pastix_int_t baseadj; @@ -589,48 +589,48 @@ void spmBase( pastix_csc_t *spm, int spmMatVec( int trans, const void *alpha, - const pastix_csc_t *csc, + const pastix_spm_t *spm, const void *x, const void *beta, void *y ) { - switch (csc->mtxtype) { + switch (spm->mtxtype) { case PastixHermitian: - switch (csc->flttype) { + switch (spm->flttype) { case PastixFloat: - return s_spmSyCSCv( *((const float*)alpha), csc, (const float*)x, *((const float*)beta), (float*)y ); + return s_spmSyCSCv( *((const float*)alpha), spm, (const float*)x, *((const float*)beta), (float*)y ); case PastixComplex32: - return c_spmHeCSCv( *((const pastix_complex32_t*)alpha), csc, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); + return c_spmHeCSCv( *((const pastix_complex32_t*)alpha), spm, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); case PastixComplex64: - return z_spmHeCSCv( *((const pastix_complex64_t*)alpha), csc, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); + return z_spmHeCSCv( *((const pastix_complex64_t*)alpha), spm, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); case PastixDouble: default: - return d_spmSyCSCv( *((const double*)alpha), csc, (const double*)x, *((const double*)beta), (double*)y ); + return d_spmSyCSCv( *((const double*)alpha), spm, (const double*)x, *((const double*)beta), (double*)y ); } case PastixSymmetric: - switch (csc->flttype) { + switch (spm->flttype) { case PastixFloat: - return s_spmSyCSCv( *((const float*)alpha), csc, (const float*)x, *((const float*)beta), (float*)y ); + return s_spmSyCSCv( *((const float*)alpha), spm, (const float*)x, *((const float*)beta), (float*)y ); case PastixComplex32: - return c_spmSyCSCv( *((const pastix_complex32_t*)alpha), csc, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); + return c_spmSyCSCv( *((const pastix_complex32_t*)alpha), spm, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); case PastixComplex64: - return z_spmSyCSCv( *((const pastix_complex64_t*)alpha), csc, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); + return z_spmSyCSCv( *((const pastix_complex64_t*)alpha), spm, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); case PastixDouble: default: - return d_spmSyCSCv( *((const double*)alpha), csc, (const double*)x, *((const double*)beta), (double*)y ); + return d_spmSyCSCv( *((const double*)alpha), spm, (const double*)x, *((const double*)beta), (double*)y ); } case PastixGeneral: default: - switch (csc->flttype) { + switch (spm->flttype) { case PastixFloat: - return s_spmGeCSCv( trans, *((const float*)alpha), csc, (const float*)x, *((const float*)beta), (float*)y ); + return s_spmGeCSCv( trans, *((const float*)alpha), spm, (const float*)x, *((const float*)beta), (float*)y ); case PastixComplex32: - return c_spmGeCSCv( trans, *((const pastix_complex32_t*)alpha), csc, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); + return c_spmGeCSCv( trans, *((const pastix_complex32_t*)alpha), spm, (const pastix_complex32_t*)x, *((const pastix_complex32_t*)beta), (pastix_complex32_t*)y ); case PastixComplex64: - return z_spmGeCSCv( trans, *((const pastix_complex64_t*)alpha), csc, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); + return z_spmGeCSCv( trans, *((const pastix_complex64_t*)alpha), spm, (const pastix_complex64_t*)x, *((const pastix_complex64_t*)beta), (pastix_complex64_t*)y ); case PastixDouble: default: - return d_spmGeCSCv( trans, *((const double*)alpha), csc, (const double*)x, *((const double*)beta), (double*)y ); + return d_spmGeCSCv( trans, *((const double*)alpha), spm, (const double*)x, *((const double*)beta), (double*)y ); } } } @@ -638,7 +638,7 @@ spmMatVec( int trans, /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmGenRHS - Generate nrhs right hand side vectors associated to a given * matrix to test a problem with a solver. @@ -685,12 +685,12 @@ spmMatVec( int trans, *******************************************************************************/ int spmGenRHS( int type, int nrhs, - const pastix_csc_t *spm, + const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ) { static int (*ptrfunc[4])(int, int, - const pastix_csc_t *, + const pastix_spm_t *, void *, int, void *, int) = { s_spmGenRHS, d_spmGenRHS, c_spmGenRHS, z_spmGenRHS @@ -708,7 +708,7 @@ spmGenRHS( int type, int nrhs, /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * spmCheckAxb - Check the backward error, and the forward error if x0 is * provided. @@ -754,12 +754,12 @@ spmGenRHS( int type, int nrhs, *******************************************************************************/ int spmCheckAxb( int nrhs, - const pastix_csc_t *spm, + const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ) { - static int (*ptrfunc[4])(int, const pastix_csc_t *, + static int (*ptrfunc[4])(int, const pastix_spm_t *, void *, int, void *, int, const void *, int) = { s_spmCheckAxb, d_spmCheckAxb, c_spmCheckAxb, z_spmCheckAxb diff --git a/csc.h b/spm.h similarity index 68% rename from csc.h rename to spm.h index 845eb53e856a5be4bef98adaf2b86563bc4d3559..e97b7809949f821db74d640ed203e25d960863a5 100644 --- a/csc.h +++ b/spm.h @@ -1,6 +1,6 @@ /** * - * @file csc.h + * @file spm.h * * PaStiX sparse matrix routines to handle different format of sparse matrices. * $COPYRIGHTS$ @@ -12,8 +12,8 @@ * @date 2013-06-24 * **/ -#ifndef _CSC_H_ -#define _CSC_H_ +#ifndef _SPM_H_ +#define _SPM_H_ /** * @ingroup pastix_spm @@ -34,6 +34,7 @@ struct pastix_spm_s { pastix_int_t *loc2glob; /*< Corresponding numbering from local to global */ void *values; /*< Values stored in the matrix */ }; +typedef struct pastix_spm_s pastix_spm_t; typedef struct pastix_spm_s pastix_csc_t; int @@ -54,26 +55,26 @@ csc_save( pastix_int_t n, int dof, FILE *outfile ); -int cscLoad( pastix_csc_t *csc, FILE *infile ); -int cscSave( pastix_csc_t *csc, FILE *outfile ); +int spmLoad( pastix_spm_t *spm, FILE *infile ); +int spmSave( pastix_spm_t *spm, FILE *outfile ); -int spmGenRHS(int type, int nrhs, const pastix_csc_t *spm, void *x, int ldx, void *b, int ldb ); -int spmCheckAxb( int nrhs, const pastix_csc_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); +int spmGenRHS(int type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ); +int spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); -void spmInit( pastix_csc_t *spm ); -void spmExit( pastix_csc_t *spm ); -pastix_csc_t *spmCopy( const pastix_csc_t *spm ); -void spmBase( pastix_csc_t *spm, int baseval ); -int spmConvert( int ofmttype, pastix_csc_t *ospm ); -pastix_int_t spmFindBase( const pastix_csc_t *spm ); -double spmNorm( int ntype, const pastix_csc_t *csc ); -int spmMatVec(int trans, const void *alpha, const pastix_csc_t *csc, const void *x, const void *beta, void *y ); +void spmInit( pastix_spm_t *spm ); +void spmExit( pastix_spm_t *spm ); +pastix_spm_t *spmCopy( const pastix_spm_t *spm ); +void spmBase( pastix_spm_t *spm, int baseval ); +int spmConvert( int ofmttype, pastix_spm_t *ospm ); +pastix_int_t spmFindBase( const pastix_spm_t *spm ); +double spmNorm( int ntype, const pastix_spm_t *spm ); +int spmMatVec(int trans, const void *alpha, const pastix_spm_t *spm, const void *x, const void *beta, void *y ); -int spmSort( pastix_csc_t *csc ); -pastix_int_t spmMergeDuplicate( pastix_csc_t *csc ); -pastix_int_t spmSymmetrize( pastix_csc_t *csc ); +int spmSort( pastix_spm_t *spm ); +pastix_int_t spmMergeDuplicate( pastix_spm_t *spm ); +pastix_int_t spmSymmetrize( pastix_spm_t *spm ); -pastix_csc_t *spmCheckAndCorrect( pastix_csc_t *csc ); +pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm ); -#endif /* _CSC_H_ */ +#endif /* _SPM_H_ */ diff --git a/csc_io.c b/spm_io.c similarity index 87% rename from csc_io.c rename to spm_io.c index e8316ed287186a79df0e04de62aa7141b148f0e6..b3b8abec85147446038afc0fd1d909c9ab2d169a 100644 --- a/csc_io.c +++ b/spm_io.c @@ -1,8 +1,8 @@ /** * - * @file csc_io.c + * @file spm_io.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,7 +14,7 @@ * **/ #include "common.h" -#include "csc.h" +#include "spm.h" static inline int readArrayOfInteger( FILE *stream, @@ -28,7 +28,7 @@ readArrayOfInteger( FILE *stream, for (i=0; i<(n-3); i+=4) { if (4 != fscanf(stream, "%ld %ld %ld %ld", &tmp1, &tmp2, &tmp3, &tmp4)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } @@ -43,7 +43,7 @@ readArrayOfInteger( FILE *stream, { case 3: if (3 != fscanf(stream, "%ld %ld %ld", &tmp1, &tmp2, &tmp3)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } @@ -53,7 +53,7 @@ readArrayOfInteger( FILE *stream, break; case 2: if (2 != fscanf(stream, "%ld %ld", &tmp1, &tmp2)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } @@ -62,7 +62,7 @@ readArrayOfInteger( FILE *stream, break; case 1: if (1 != fscanf(stream, "%ld", &tmp1)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } @@ -88,7 +88,7 @@ readArrayOfComplex64( FILE *stream, if (8 != fscanf(stream, "%lg %lg %lg %lg %lg %lg %lg %lg", &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6, &tmp7, &tmp8)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex64_t)(tmp1 + I * tmp2); @@ -104,7 +104,7 @@ readArrayOfComplex64( FILE *stream, if (6 != fscanf(stream, "%lg %lg %lg %lg %lg %lg", &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex64_t)(tmp1 + I * tmp2); @@ -115,7 +115,7 @@ readArrayOfComplex64( FILE *stream, case 2: if (4 != fscanf(stream, "%lg %lg %lg %lg", &tmp1, &tmp2, &tmp3, &tmp4)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex64_t)(tmp1 + I * tmp2); @@ -125,7 +125,7 @@ readArrayOfComplex64( FILE *stream, case 1: if (2 != fscanf(stream, "%lg %lg", &tmp1, &tmp2)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex64_t)(tmp1 + I * tmp2); @@ -150,7 +150,7 @@ readArrayOfComplex32( FILE *stream, if (8 != fscanf(stream, "%g %g %g %g %g %g %g %g", &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6, &tmp7, &tmp8)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex32_t)(tmp1 + I * tmp2); @@ -166,7 +166,7 @@ readArrayOfComplex32( FILE *stream, if (6 != fscanf(stream, "%g %g %g %g %g %g", &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex32_t)(tmp1 + I * tmp2); @@ -177,7 +177,7 @@ readArrayOfComplex32( FILE *stream, case 2: if (4 != fscanf(stream, "%g %g %g %g", &tmp1, &tmp2, &tmp3, &tmp4)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex32_t)(tmp1 + I * tmp2); @@ -187,7 +187,7 @@ readArrayOfComplex32( FILE *stream, case 1: if (2 != fscanf(stream, "%g %g", &tmp1, &tmp2)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (pastix_complex32_t)(tmp1 + I * tmp2); @@ -210,7 +210,7 @@ readArrayOfDouble( FILE *stream, { if (4 != fscanf(stream, "%lg %lg %lg %lg", &tmp1, &tmp2, &tmp3, &tmp4)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (double)(tmp1); @@ -225,7 +225,7 @@ readArrayOfDouble( FILE *stream, case 3: if (1 != fscanf(stream, "%lg %lg %lg", &tmp1, &tmp2, &tmp3)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (double)(tmp1); @@ -236,7 +236,7 @@ readArrayOfDouble( FILE *stream, case 2: if (2 != fscanf(stream, "%lg %lg", &tmp1, &tmp2)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (double)(tmp1); @@ -246,7 +246,7 @@ readArrayOfDouble( FILE *stream, case 1: if (1 != fscanf(stream, "%lg", &tmp1)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (double)(tmp1); @@ -269,7 +269,7 @@ readArrayOfFloat( FILE *stream, { if (4 != fscanf(stream, "%g %g %g %g", &tmp1, &tmp2, &tmp3, &tmp4)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (float)(tmp1); @@ -284,7 +284,7 @@ readArrayOfFloat( FILE *stream, case 3: if (3 != fscanf(stream, "%g %g %g", &tmp1, &tmp2, &tmp3)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (float)(tmp1); @@ -295,7 +295,7 @@ readArrayOfFloat( FILE *stream, case 2: if (2 != fscanf(stream, "%g %g", &tmp1, &tmp2)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (float)(tmp1); @@ -304,7 +304,7 @@ readArrayOfFloat( FILE *stream, case 1: if (1 != fscanf(stream, "%g", &tmp1)){ - errorPrint("cscLoad: Wrong input format"); + errorPrint("spmLoad: Wrong input format"); return EXIT_FAILURE; } array[i ] = (float)(tmp1); @@ -315,9 +315,9 @@ readArrayOfFloat( FILE *stream, } /* - Function: csc_load + Function: spm_load - Load a csc from disk. + Load a spm from disk. Fill *n*, *colptr*, *rowptr*, *values* and *dof* from *infile*. @@ -348,7 +348,7 @@ csc_load( pastix_int_t *n, /* Read the header file */ if (3 != fscanf(infile, "%ld %ld %d\n", &tmp1, &tmp2, &ft)) { - errorPrint("cscLoad:line 1: Wrong input"); + errorPrint("spmLoad:line 1: Wrong input"); return EXIT_FAILURE; } @@ -418,21 +418,21 @@ csc_load( pastix_int_t *n, } int -cscLoad( pastix_csc_t *csc, +spmLoad( pastix_spm_t *spm, FILE *infile ) { int rc, dof = 1; - rc = csc_load( &(csc->n), - &(csc->colptr), - &(csc->rowptr), - &(csc->flttype), - &(csc->values), + rc = csc_load( &(spm->n), + &(spm->colptr), + &(spm->rowptr), + &(spm->flttype), + &(spm->values), &dof, infile ); - csc->gN = csc->n; - csc->loc2glob = NULL; + spm->gN = spm->n; + spm->loc2glob = NULL; return rc; } @@ -488,14 +488,14 @@ csc_save( pastix_int_t n, } int -cscSave( pastix_csc_t *csc, +spmSave( pastix_spm_t *spm, FILE *outfile ) { - return csc_save( csc->n, - csc->colptr, - csc->rowptr, - csc->flttype, - csc->values, + return csc_save( spm->n, + spm->colptr, + spm->rowptr, + spm->flttype, + spm->values, 1, outfile ); } diff --git a/z_spm.c b/z_spm.c index 88da6b1d74102b2d7e24e028d4a6db563878989d..ababb3a28454dce3a9901c72cfa76e3c8e672418 100644 --- a/z_spm.c +++ b/z_spm.c @@ -14,7 +14,7 @@ * **/ #include "common.h" -#include "csc.h" +#include "spm.h" /** ******************************************************************************* @@ -36,23 +36,23 @@ * *******************************************************************************/ void -z_spmSort( pastix_csc_t *csc ) +z_spmSort( pastix_spm_t *spm ) { - pastix_int_t *colptr = csc->colptr; - pastix_int_t *rowptr = csc->rowptr; - pastix_complex64_t *values = csc->values; + pastix_int_t *colptr = spm->colptr; + pastix_int_t *rowptr = spm->rowptr; + pastix_complex64_t *values = spm->values; void *sortptr[2]; - pastix_int_t n = csc->n; + pastix_int_t n = spm->n; pastix_int_t i, size; (void)sortptr; - if (csc->dof > 1){ - fprintf(stderr, "z_spmSort: Number of dof (%d) greater than one not supported\n", (int)csc->dof); + if (spm->dof > 1){ + fprintf(stderr, "z_spmSort: Number of dof (%d) greater than one not supported\n", (int)spm->dof); exit(1); } /* Sort in place each subset */ - if ( csc->fmttype == PastixCSC ) { + if ( spm->fmttype == PastixCSC ) { for (i=0; i<n; i++, colptr++) { size = colptr[1] - colptr[0]; @@ -68,7 +68,7 @@ z_spmSort( pastix_csc_t *csc ) values += size; } } - else if ( csc->fmttype == PastixCSR ) { + else if ( spm->fmttype == PastixCSR ) { for (i=0; i<n; i++, rowptr++) { size = rowptr[1] - rowptr[0]; @@ -112,21 +112,21 @@ z_spmSort( pastix_csc_t *csc ) * *******************************************************************************/ pastix_int_t -z_spmMergeDuplicate( pastix_csc_t *csc ) +z_spmMergeDuplicate( pastix_spm_t *spm ) { - pastix_int_t *colptr = csc->colptr; - pastix_int_t *oldrow = csc->rowptr; - pastix_int_t *newrow = csc->rowptr; - pastix_complex64_t *newval = csc->values; - pastix_complex64_t *oldval = csc->values; - pastix_int_t n = csc->n; - pastix_int_t baseval = csc->colptr[0]; - pastix_int_t dof2 = csc->dof * csc->dof; + pastix_int_t *colptr = spm->colptr; + pastix_int_t *oldrow = spm->rowptr; + pastix_int_t *newrow = spm->rowptr; + pastix_complex64_t *newval = spm->values; + pastix_complex64_t *oldval = spm->values; + pastix_int_t n = spm->n; + pastix_int_t baseval = spm->colptr[0]; + pastix_int_t dof2 = spm->dof * spm->dof; pastix_int_t idx, i, j, d, size; pastix_int_t merge = 0; (void)d; - if ( csc->fmttype == PastixCSC ) { + if ( spm->fmttype == PastixCSC ) { idx = 0; for (i=0; i<n; i++, colptr++) { @@ -157,23 +157,23 @@ z_spmMergeDuplicate( pastix_csc_t *csc ) colptr[1] = idx + baseval; } - assert( ((merge == 0) && (csc->nnz == idx)) || - ((merge != 0) && (csc->nnz - merge == idx)) ); + assert( ((merge == 0) && (spm->nnz == idx)) || + ((merge != 0) && (spm->nnz - merge == idx)) ); if (merge > 0) { - csc->nnz = csc->nnz - merge; - csc->gnnz = csc->nnz; + spm->nnz = spm->nnz - merge; + spm->gnnz = spm->nnz; - newrow = malloc( csc->nnz * sizeof(pastix_int_t) ); - memcpy( newrow, csc->rowptr, csc->nnz * sizeof(pastix_int_t) ); - free(csc->rowptr); - csc->rowptr = newrow; + newrow = malloc( spm->nnz * sizeof(pastix_int_t) ); + memcpy( newrow, spm->rowptr, spm->nnz * sizeof(pastix_int_t) ); + free(spm->rowptr); + spm->rowptr = newrow; #if !defined(PRECISION_p) - newval = malloc( csc->nnz * dof2 * sizeof(pastix_int_t) ); - memcpy( newval, csc->values, csc->nnz * dof2 * sizeof(pastix_complex64_t) ); - free(csc->values); - csc->values = newval; + newval = malloc( spm->nnz * dof2 * sizeof(pastix_int_t) ); + memcpy( newval, spm->values, spm->nnz * dof2 * sizeof(pastix_complex64_t) ); + free(spm->values); + spm->values = newval; #endif } } @@ -205,32 +205,32 @@ z_spmMergeDuplicate( pastix_csc_t *csc ) * *******************************************************************************/ pastix_int_t -z_spmSymmetrize( pastix_csc_t *csc ) +z_spmSymmetrize( pastix_spm_t *spm ) { pastix_complex64_t *oldval, *valtmp, *newval = NULL; pastix_int_t *oldcol, *coltmp, *newcol = NULL; pastix_int_t *oldrow, *rowtmp, *newrow = NULL; pastix_int_t *toaddtab, *toaddtmp, toaddcnt, toaddsze; - pastix_int_t n = csc->n; - pastix_int_t dof2 = csc->dof * csc->dof; + pastix_int_t n = spm->n; + pastix_int_t dof2 = spm->dof * spm->dof; pastix_int_t i, j, k, r, size; pastix_int_t baseval; toaddcnt = 0; toaddsze = 0; - if ( (csc->fmttype == PastixCSC) || (csc->fmttype == PastixCSR) ) { - if (csc->fmttype == PastixCSC) { - oldcol = csc->colptr; - coltmp = csc->colptr; - oldrow = csc->rowptr; - rowtmp = csc->rowptr; + if ( (spm->fmttype == PastixCSC) || (spm->fmttype == PastixCSR) ) { + if (spm->fmttype == PastixCSC) { + oldcol = spm->colptr; + coltmp = spm->colptr; + oldrow = spm->rowptr; + rowtmp = spm->rowptr; } else { - oldcol = csc->rowptr; - coltmp = csc->rowptr; - oldrow = csc->colptr; - rowtmp = csc->colptr; + oldcol = spm->rowptr; + coltmp = spm->rowptr; + oldrow = spm->colptr; + rowtmp = spm->colptr; } baseval = oldcol[0]; @@ -255,20 +255,20 @@ z_spmSymmetrize( pastix_csc_t *csc ) } else if ( i < (oldrow[k]-baseval)) { - /* The csc is sorted so we will not find it later */ + /* The spm is sorted so we will not find it later */ break; } } if ( !found ) { if ( newcol == NULL ) { - newcol = malloc( (csc->n+1) * sizeof(pastix_int_t) ); - for (k=0; k<csc->n; k++) { + newcol = malloc( (spm->n+1) * sizeof(pastix_int_t) ); + for (k=0; k<spm->n; k++) { newcol[k] = oldcol[k+1] - oldcol[k]; } /* Let's start with a buffer that will contain 5% of extra elements */ - toaddsze = pastix_imax( 0.05 * (double)csc->nnz, 1 ); + toaddsze = pastix_imax( 0.05 * (double)spm->nnz, 1 ); MALLOC_INTERN(toaddtab, 2*toaddsze, pastix_int_t); } @@ -294,17 +294,17 @@ z_spmSymmetrize( pastix_csc_t *csc ) /* Sort the array per column */ intSort2asc1(toaddtab, toaddcnt); - csc->nnz = csc->nnz + toaddcnt; - csc->gnnz = csc->nnz; + spm->nnz = spm->nnz + toaddcnt; + spm->gnnz = spm->nnz; - newrow = malloc( csc->nnz * sizeof(pastix_int_t) ); + newrow = malloc( spm->nnz * sizeof(pastix_int_t) ); #if !defined(PRECISION_p) - newval = malloc( csc->nnz * dof2 * sizeof(pastix_complex64_t) ); + newval = malloc( spm->nnz * dof2 * sizeof(pastix_complex64_t) ); #endif coltmp = newcol; rowtmp = newrow; valtmp = newval; - oldval = csc->values; + oldval = spm->values; toaddtmp = toaddtab; newsize = coltmp[0]; @@ -352,20 +352,20 @@ z_spmSymmetrize( pastix_csc_t *csc ) coltmp[1] = coltmp[0] + oldsize; } - assert( coltmp[0]-baseval == csc->nnz ); + assert( coltmp[0]-baseval == spm->nnz ); free( toaddtab ); - free( csc->colptr ); - free( csc->rowptr ); - free( csc->values ); - if (csc->fmttype == PastixCSC) { - csc->colptr = newcol; - csc->rowptr = newrow; + free( spm->colptr ); + free( spm->rowptr ); + free( spm->values ); + if (spm->fmttype == PastixCSC) { + spm->colptr = newcol; + spm->rowptr = newrow; } else { - csc->colptr = newrow; - csc->rowptr = newcol; + spm->colptr = newrow; + spm->rowptr = newcol; } - csc->values = newval; + spm->values = newval; } } diff --git a/z_spm.h b/z_spm.h index 5427370b22fd08605c7c5fe83f148181b0ea8e61..877da184bbc1a4e9a638d9e3f3d20889513373bb 100644 --- a/z_spm.h +++ b/z_spm.h @@ -18,23 +18,23 @@ #ifndef _z_spm_H_ #define _z_spm_H_ -int z_spmConvertCSC2CSR( pastix_csc_t *spm ); -int z_spmConvertCSC2IJV( pastix_csc_t *spm ); -int z_spmConvertCSR2CSC( pastix_csc_t *spm ); -int z_spmConvertCSR2IJV( pastix_csc_t *spm ); -int z_spmConvertIJV2CSC( pastix_csc_t *spm ); -int z_spmConvertIJV2CSR( pastix_csc_t *spm ); +int z_spmConvertCSC2CSR( pastix_spm_t *spm ); +int z_spmConvertCSC2IJV( pastix_spm_t *spm ); +int z_spmConvertCSR2CSC( pastix_spm_t *spm ); +int z_spmConvertCSR2IJV( pastix_spm_t *spm ); +int z_spmConvertIJV2CSC( pastix_spm_t *spm ); +int z_spmConvertIJV2CSR( pastix_spm_t *spm ); -int z_spmGeCSCv(int trans, pastix_complex64_t alpha, const pastix_csc_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); -int z_spmSyCSCv( pastix_complex64_t alpha, const pastix_csc_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); -int z_spmHeCSCv( pastix_complex64_t alpha, const pastix_csc_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); +int z_spmGeCSCv(int trans, pastix_complex64_t alpha, const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); +int z_spmSyCSCv( pastix_complex64_t alpha, const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); +int z_spmHeCSCv( pastix_complex64_t alpha, const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y); -double z_spmNorm( int ntype, const pastix_csc_t *csc ); -void z_spmSort( pastix_csc_t *csc ); -pastix_int_t z_spmMergeDuplicate( pastix_csc_t *csc ); -pastix_int_t z_spmSymmetrize( pastix_csc_t *csc ); +double z_spmNorm( int ntype, const pastix_spm_t *csc ); +void z_spmSort( pastix_spm_t *csc ); +pastix_int_t z_spmMergeDuplicate( pastix_spm_t *csc ); +pastix_int_t z_spmSymmetrize( pastix_spm_t *csc ); -int z_spmGenRHS(int type, int nrhs, const pastix_csc_t *spm, void *x, int ldx, void *b, int ldb ); -int z_spmCheckAxb( int nrhs, const pastix_csc_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); +int z_spmGenRHS(int type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ); +int z_spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ); #endif /* _z_spm_H_ */ diff --git a/z_spm_convert_to_csc.c b/z_spm_convert_to_csc.c index 4b3656a91b32939ebbfa037ffc836822533f7c4c..72b96a235f7d7a6f6be8e272ab2e801e4f4b7d3c 100644 --- a/z_spm_convert_to_csc.c +++ b/z_spm_convert_to_csc.c @@ -2,7 +2,7 @@ * * @file z_spm_convert_to_csc.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,13 +14,13 @@ * @precisions normal z -> c d s p **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertIJV2CSC - convert a matrix in IJV format to a matrix in CSC * format. @@ -38,7 +38,7 @@ * *******************************************************************************/ int -z_spmConvertIJV2CSC( pastix_csc_t *spm ) +z_spmConvertIJV2CSC( pastix_spm_t *spm ) { #if !defined(PRECISION_p) pastix_complex64_t *navals = NULL; @@ -46,10 +46,10 @@ z_spmConvertIJV2CSC( pastix_csc_t *spm ) #endif pastix_int_t *spmptx, *otmp; pastix_int_t i, j, tmp, baseval, total; - pastix_csc_t oldspm; + pastix_spm_t oldspm; /* Backup the input */ - memcpy( &oldspm, spm, sizeof(pastix_csc_t) ); + memcpy( &oldspm, spm, sizeof(pastix_spm_t) ); /* * Check the baseval, we consider that arrays are sorted by columns or rows @@ -126,7 +126,7 @@ z_spmConvertIJV2CSC( pastix_csc_t *spm ) /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertCSR2CSC - convert a matrix in CSR format to a matrix in CSC * format. If the matrix is PastixSymmetric or PastixHermitian, then the @@ -145,7 +145,7 @@ z_spmConvertIJV2CSC( pastix_csc_t *spm ) * *******************************************************************************/ int -z_spmConvertCSR2CSC( pastix_csc_t *spm ) +z_spmConvertCSR2CSC( pastix_spm_t *spm ) { assert( spm->loc2glob == NULL ); assert( spm->fmttype == PastixCSR ); diff --git a/z_spm_convert_to_csr.c b/z_spm_convert_to_csr.c index 20b07f28870a11576ad420b6d7c8d1df06449374..ef7b8f35befd14f4e0a99d6bad75bac9588d7f2a 100644 --- a/z_spm_convert_to_csr.c +++ b/z_spm_convert_to_csr.c @@ -2,7 +2,7 @@ * * @file z_spm_convert_to_csr.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,13 +14,13 @@ * @precisions normal z -> c d s p **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertCSC2CSR - convert a matrix in CSC format to a matrix in CSR * format. If the matrix is PastixSymmetric or PastixHermitian, then the @@ -39,7 +39,7 @@ * *******************************************************************************/ int -z_spmConvertCSC2CSR( pastix_csc_t *spm ) +z_spmConvertCSC2CSR( pastix_spm_t *spm ) { pastix_int_t *tmp; pastix_int_t result; @@ -97,7 +97,7 @@ z_spmConvertCSC2CSR( pastix_csc_t *spm ) /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertIJV2CSR - convert a matrix in IJV format to a matrix in CSR * format. @@ -115,7 +115,7 @@ z_spmConvertCSC2CSR( pastix_csc_t *spm ) * *******************************************************************************/ int -z_spmConvertIJV2CSR( pastix_csc_t *spm ) +z_spmConvertIJV2CSR( pastix_spm_t *spm ) { #if !defined(PRECISION_p) pastix_complex64_t *navals = NULL; @@ -123,10 +123,10 @@ z_spmConvertIJV2CSR( pastix_csc_t *spm ) #endif pastix_int_t *spmptx, *otmp; pastix_int_t i, j, tmp, baseval, total; - pastix_csc_t oldspm; + pastix_spm_t oldspm; /* Backup the input */ - memcpy( &oldspm, spm, sizeof(pastix_csc_t) ); + memcpy( &oldspm, spm, sizeof(pastix_spm_t) ); /* * Check the baseval, we consider that arrays are sorted by columns or rows diff --git a/z_spm_convert_to_ijv.c b/z_spm_convert_to_ijv.c index 13dbc57f54fb50e290963d87d076ac22d780bb52..68fa025eb75197aee30fef11230344b36212ced8 100644 --- a/z_spm_convert_to_ijv.c +++ b/z_spm_convert_to_ijv.c @@ -2,7 +2,7 @@ * * @file z_spm_convert_to_ijv.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,13 +14,13 @@ * @precisions normal z -> c d s p **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertCSC2IJV - convert a matrix in CSC format to a matrix in IJV * format. @@ -38,7 +38,7 @@ * *******************************************************************************/ int -z_spmConvertCSC2IJV( pastix_csc_t *spm ) +z_spmConvertCSC2IJV( pastix_spm_t *spm ) { pastix_int_t *col_ijv, *colptr; pastix_int_t i, j, baseval, nnz; @@ -71,7 +71,7 @@ z_spmConvertCSC2IJV( pastix_csc_t *spm ) /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmConvertCSR2IJV - convert a matrix in CSR format to a matrix in IJV * format. @@ -89,7 +89,7 @@ z_spmConvertCSC2IJV( pastix_csc_t *spm ) * *******************************************************************************/ int -z_spmConvertCSR2IJV( pastix_csc_t *spm ) +z_spmConvertCSR2IJV( pastix_spm_t *spm ) { pastix_int_t *row_ijv, *rowptr; pastix_int_t i, j, baseval, nnz; diff --git a/z_spm_genrhs.c b/z_spm_genrhs.c index fb91b8b1e7ef31f559419b8494a576bfbf57c49b..5bf7b9b0a3d1be95bf5544ffb53ac091aef429b5 100644 --- a/z_spm_genrhs.c +++ b/z_spm_genrhs.c @@ -2,7 +2,7 @@ * * @file z_spm_genrhs.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -15,7 +15,7 @@ **/ #include <lapacke.h> #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" #include "kernels/pastix_zcores.h" @@ -52,7 +52,7 @@ Rnd64_jump(unsigned long long int n, unsigned long long int seed ) { /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmRndVect generates a random vector for testing purpose. * @@ -113,7 +113,7 @@ void z_spmRndVect( double scale, int m, int n, pastix_complex64_t *A, int lda, /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmGenRHS - Generate nrhs right hand side vectors associated to a given * matrix to test a problem with a solver. @@ -160,7 +160,7 @@ void z_spmRndVect( double scale, int m, int n, pastix_complex64_t *A, int lda, *******************************************************************************/ int z_spmGenRHS( int type, int nrhs, - const pastix_csc_t *spm, + const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ) { @@ -283,7 +283,7 @@ z_spmGenRHS( int type, int nrhs, /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmCheckAxb - Check the backward error, and the forward error if x0 is * provided. @@ -329,7 +329,7 @@ z_spmGenRHS( int type, int nrhs, *******************************************************************************/ int z_spmCheckAxb( int nrhs, - const pastix_csc_t *spm, + const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx ) diff --git a/z_spm_matrixvector.c b/z_spm_matrixvector.c index 8d23dd4d947c3908dfb325cbf9ef4f988dd80ca0..7db1de700c9cfb1772956a6e11e6444e20270db2 100644 --- a/z_spm_matrixvector.c +++ b/z_spm_matrixvector.c @@ -2,7 +2,7 @@ * * @file z_spm_matrixvector.c * - * PaStiX csc routines + * PaStiX spm routines * PaStiX is a software package provided by Inria Bordeaux - Sud-Ouest, * LaBRI, University of Bordeaux 1 and IPB. * @@ -14,13 +14,13 @@ * @precisions normal z -> c d s **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" /** ******************************************************************************* * - * @ingroup pastix_csc + * @ingroup pastix_spm * * z_spmGeCSCv - compute the matrix-vector product: * y = alpha * op( A ) + beta * y @@ -65,7 +65,7 @@ int z_spmGeCSCv( int trans, pastix_complex64_t alpha, - const pastix_csc_t *csc, + const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y ) @@ -186,7 +186,7 @@ z_spmGeCSCv( int trans, *******************************************************************************/ int z_spmSyCSCv( pastix_complex64_t alpha, - const pastix_csc_t *csc, + const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y ) @@ -275,7 +275,7 @@ z_spmSyCSCv( pastix_complex64_t alpha, *******************************************************************************/ int z_spmHeCSCv( pastix_complex64_t alpha, - const pastix_csc_t *csc, + const pastix_spm_t *csc, const pastix_complex64_t *x, pastix_complex64_t beta, pastix_complex64_t *y ) diff --git a/z_spm_norm.c b/z_spm_norm.c index 2c34406f9ccbbb1833f284c618623ab5dbe2f9bf..afa9ffdb3b356132f11a6c856ef1df17b67e5043 100644 --- a/z_spm_norm.c +++ b/z_spm_norm.c @@ -16,7 +16,7 @@ * **/ #include "common.h" -#include "csc.h" +#include "spm.h" #include "z_spm.h" #include "frobeniusupdate.h" @@ -42,7 +42,7 @@ * *******************************************************************************/ double -z_spmFrobeniusNorm( const pastix_csc_t *spm ) +z_spmFrobeniusNorm( const pastix_spm_t *spm ) { pastix_int_t i, j, baseval; double *valptr = (double*)spm->values; @@ -133,7 +133,7 @@ z_spmFrobeniusNorm( const pastix_csc_t *spm ) * *******************************************************************************/ double -z_spmMaxNorm( const pastix_csc_t *spm ) +z_spmMaxNorm( const pastix_spm_t *spm ) { pastix_int_t i; pastix_complex64_t *valptr = (pastix_complex64_t*)spm->values; @@ -169,7 +169,7 @@ z_spmMaxNorm( const pastix_csc_t *spm ) * *******************************************************************************/ double -z_spmInfNorm( const pastix_csc_t *spm ) +z_spmInfNorm( const pastix_spm_t *spm ) { pastix_int_t col, row, i, baseval; pastix_complex64_t *valptr = (pastix_complex64_t*)spm->values; @@ -284,7 +284,7 @@ z_spmInfNorm( const pastix_csc_t *spm ) * *******************************************************************************/ double -z_spmOneNorm( const pastix_csc_t *spm ) +z_spmOneNorm( const pastix_spm_t *spm ) { pastix_int_t col, row, i, baseval; pastix_complex64_t *valptr = (pastix_complex64_t*)spm->values; @@ -403,7 +403,7 @@ z_spmOneNorm( const pastix_csc_t *spm ) *******************************************************************************/ double z_spmNorm( int ntype, - const pastix_csc_t *spm) + const pastix_spm_t *spm) { double norm = 0.;