Mentions légales du service

Skip to content
Snippets Groups Projects
Commit b89aec1c authored by PICHON Gregoire's avatar PICHON Gregoire
Browse files

add example with compression and remove useless scaling without compression

parent 63f5c9ad
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "s_spm.h" #include "s_spm.h"
#include "p_spm.h" #include "p_spm.h"
#include <cblas.h>
#if !defined(DOXYGEN_SHOULD_SKIP_THIS) #if !defined(DOXYGEN_SHOULD_SKIP_THIS)
static int (*conversionTable[3][3][6])(pastix_spm_t*) = { static int (*conversionTable[3][3][6])(pastix_spm_t*) = {
...@@ -1179,7 +1181,7 @@ spmCheckAxb( int nrhs, ...@@ -1179,7 +1181,7 @@ spmCheckAxb( int nrhs,
* *
*******************************************************************************/ *******************************************************************************/
void void
spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm) spmScalMatrix(const pastix_complex64_t alpha, pastix_spm_t* spm)
{ {
switch(spm->flttype) switch(spm->flttype)
{ {
...@@ -1200,6 +1202,47 @@ spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm) ...@@ -1200,6 +1202,47 @@ spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm)
} }
} }
/**
*******************************************************************************
*
* @brief Scale a vector according to the spm type.
*
* x = alpha * x
*
*******************************************************************************
*
* @param[in] alpha
* The scaling parameter.
*
* @param[in] spm
* The spm structure to know the type of the vector.
*
* @param[inout] x
* The vector to scal.
*
*******************************************************************************/
void
spmScalVector(const double alpha, pastix_spm_t* spm, void *x)
{
switch(spm->flttype)
{
case PastixPattern:
break;
case PastixFloat:
cblas_sscal(spm->n, alpha, x, 1);
break;
case PastixComplex32:
cblas_csscal(spm->n, alpha, x, 1);
break;
case PastixComplex64:
cblas_zdscal(spm->n, alpha, x, 1);
break;
case PastixDouble:
default:
cblas_dscal(spm->n, alpha, x, 1);
}
}
/** /**
* @} * @}
*/ */
...@@ -90,7 +90,8 @@ void spmUpdateComputedFields( pastix_spm_t *spm ); ...@@ -90,7 +90,8 @@ void spmUpdateComputedFields( pastix_spm_t *spm );
*/ */
double spmNorm( pastix_normtype_t ntype, const pastix_spm_t *spm ); double spmNorm( pastix_normtype_t ntype, const pastix_spm_t *spm );
int spmMatVec(const pastix_trans_t trans, const void *alpha, const pastix_spm_t *spm, const void *x, const void *beta, void *y ); int spmMatVec(const pastix_trans_t trans, const void *alpha, const pastix_spm_t *spm, const void *x, const void *beta, void *y );
void spmScal( const pastix_complex64_t alpha, pastix_spm_t* spm ); void spmScalMatrix( const pastix_complex64_t alpha, pastix_spm_t* spm );
void spmScalVector( const double alpha, pastix_spm_t* spm, void *x );
/** /**
* @} * @}
......
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