Newer
Older

Mathieu Faverge
committed
* On exit, b is initialized as defined by the type parameter.
*
* @param[in] ldb
* Defines the leading dimension of b when multiple right hand sides
* are available. ldb >= spm->n.
*
*******************************************************************************
*
* @retval PASTIX_SUCCESS if the b vector has been computed successfully,
* @retval PASTIX_ERR_BADPARAMETER otherwise.

Mathieu Faverge
committed
*
*******************************************************************************/
int
spmGenRHS( int type, int nrhs,

Mathieu Faverge
committed
void *x, int ldx,
void *b, int ldb )
{
static int (*ptrfunc[4])(int, int,

Mathieu Faverge
committed
void *, int, void *, int) =
{
s_spmGenRHS, d_spmGenRHS, c_spmGenRHS, z_spmGenRHS
};
int id = spm->flttype - PastixFloat;
if ( (id < 0) || (id > 3) ) {
return PASTIX_ERR_BADPARAMETER;
}
else {
return ptrfunc[id](type, nrhs, spm, x, ldx, b, ldb );
}
}
/**
*******************************************************************************
*
* @brief Check the backward error, and the forward error if x0 is provided.

Mathieu Faverge
committed
*
*******************************************************************************
*
* @param[in] nrhs
* Defines the number of right hand side that must be generated.
*
* @param[in] spm
* The sparse matrix used to generate the right hand side, and the

Mathieu Faverge
committed
* solution of the full problem.
*

Mathieu Faverge
committed
* If x0 != NULL, the forward error is computed.

Mathieu Faverge
committed
*
* @param[in] ldx0
* Defines the leading dimension of x0 when multiple right hand sides
* are available. ldx0 >= spm->n.
*

Mathieu Faverge
committed
* b is a matrix of size at least ldb * nrhs.
* On exit, b stores Ax-b.
*
* @param[in] ldb
* Defines the leading dimension of b when multiple right hand sides
* are available. ldb >= spm->n.
*
* @param[in] x
* Contains the solution computed by the solver.
*
* @param[in] ldx
* Defines the leading dimension of x when multiple right hand sides
* are available. ldx >= spm->n.
*
*******************************************************************************
*
* @retval PASTIX_SUCCESS if the b vector has been computed successfully,
* @retval PASTIX_ERR_BADPARAMETER otherwise.

Mathieu Faverge
committed
*
*******************************************************************************/
int
spmCheckAxb( int nrhs,

Mathieu Faverge
committed
void *x0, int ldx0,
void *b, int ldb,
const void *x, int ldx )
{
static int (*ptrfunc[4])(int, const pastix_spm_t *,

Mathieu Faverge
committed
void *, int, void *, int, const void *, int) =
{
s_spmCheckAxb, d_spmCheckAxb, c_spmCheckAxb, z_spmCheckAxb
};
int id = spm->flttype - PastixFloat;
if ( (id < 0) || (id > 3) ) {
return PASTIX_ERR_BADPARAMETER;
}
else {
return ptrfunc[id](nrhs, spm, x0, ldx0, b, ldb, x, ldx );
}
}
/**
*******************************************************************************
*
*
*******************************************************************************
*
* @param[in] alpha
* The scaling parameter.
*
* The sparse matrix to scal.
*
*******************************************************************************/
void
spmScal(const pastix_complex64_t alpha, pastix_spm_t* spm)
{
switch(spm->flttype)
{
case PastixPattern:
break;
case PastixFloat:
break;
case PastixComplex32:
break;
case PastixComplex64:
break;
case PastixDouble:
default:
}
}