Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a81e29f8 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Add spmPrint function

parent 6f7a562f
No related branches found
No related tags found
No related merge requests found
...@@ -766,6 +766,45 @@ spmCopy( const pastix_spm_t *spm ) ...@@ -766,6 +766,45 @@ spmCopy( const pastix_spm_t *spm )
return newspm; return newspm;
} }
/**
*******************************************************************************
*
* @ingroup pastix_spm
*
* @brief Print an spm matrix into into a given file.
*
*******************************************************************************
*
* @param[in] f
* File to print the spm matrix
*
* @param[in] spm
* The sparse matrix to copy.
*
*******************************************************************************/
void
spmPrint(FILE *f, const pastix_spm_t* spm)
{
switch(spm->flttype)
{
case PastixPattern:
//return p_f, spmPrint(f, spm);
break;
case PastixFloat:
s_spmPrint(f, spm);
break;
case PastixComplex32:
c_spmPrint(f, spm);
break;
case PastixComplex64:
z_spmPrint(f, spm);
break;
case PastixDouble:
default:
d_spmPrint(f, spm);
}
}
/** /**
******************************************************************************* *******************************************************************************
* *
......
...@@ -136,6 +136,8 @@ static inline void s_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, float ...@@ -136,6 +136,8 @@ static inline void s_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, float
int spmLoad( pastix_spm_t *spm, FILE *infile ); int spmLoad( pastix_spm_t *spm, FILE *infile );
int spmSave( pastix_spm_t *spm, FILE *outfile ); int spmSave( pastix_spm_t *spm, FILE *outfile );
void spmPrint( FILE *f, const pastix_spm_t *spm );
int spmGenRHS(int type, int nrhs, const pastix_spm_t *spm, void *x, int ldx, void *b, int ldb ); 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 ); int spmCheckAxb( int nrhs, const pastix_spm_t *spm, void *x0, int ldx0, void *b, int ldb, const void *x, int ldx );
......
...@@ -32,7 +32,7 @@ z_spmCSCPrint( FILE *f, const pastix_spm_t *spm ) ...@@ -32,7 +32,7 @@ z_spmCSCPrint( FILE *f, const pastix_spm_t *spm )
pastix_complex64_t *valptr; pastix_complex64_t *valptr;
pastix_int_t *colptr, *rowptr, *dofs; pastix_int_t *colptr, *rowptr, *dofs;
assert( (spm->fmttype == PastixCSC) || (spm->fmttype == PastixCSR) ); assert( spm->fmttype == PastixCSC );
assert( spm->flttype == PastixComplex64 ); assert( spm->flttype == PastixComplex64 );
baseval = spmFindBase( spm ); baseval = spmFindBase( spm );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment