SpM Handbook 1.2.4
Loading...
Searching...
No Matches
Spm_dev_convert

Conversion routines. More...

Functions

int s_spmConvertCSC2CSR (spmatrix_t *spm)
 convert a matrix in CSC format to a matrix in CSR format.
 
int s_spmConvertCSC2IJV (spmatrix_t *spm)
 Convert a matrix in CSC format to a matrix in IJV format.
 
int s_spmConvertCSR2CSC (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in CSC format.
 
int s_spmConvertCSR2IJV (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in IJV format.
 
int s_spmConvertIJV2CSC (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSC format.
 
int s_spmConvertIJV2CSR (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSR format.
 
void s_spm2dense (const spmatrix_t *spm, float *A)
 Convert a sparse matrix into a dense matrix.
 
int d_spmConvertCSC2CSR (spmatrix_t *spm)
 convert a matrix in CSC format to a matrix in CSR format.
 
int d_spmConvertCSC2IJV (spmatrix_t *spm)
 Convert a matrix in CSC format to a matrix in IJV format.
 
int d_spmConvertCSR2CSC (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in CSC format.
 
int d_spmConvertCSR2IJV (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in IJV format.
 
int d_spmConvertIJV2CSC (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSC format.
 
int d_spmConvertIJV2CSR (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSR format.
 
void d_spm2dense (const spmatrix_t *spm, double *A)
 Convert a sparse matrix into a dense matrix.
 
int c_spmConvertCSC2CSR (spmatrix_t *spm)
 convert a matrix in CSC format to a matrix in CSR format.
 
int c_spmConvertCSC2IJV (spmatrix_t *spm)
 Convert a matrix in CSC format to a matrix in IJV format.
 
int c_spmConvertCSR2CSC (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in CSC format.
 
int c_spmConvertCSR2IJV (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in IJV format.
 
int c_spmConvertIJV2CSC (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSC format.
 
int c_spmConvertIJV2CSR (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSR format.
 
void c_spm2dense (const spmatrix_t *spm, spm_complex32_t *A)
 Convert a sparse matrix into a dense matrix.
 
int z_spmConvertCSC2CSR (spmatrix_t *spm)
 convert a matrix in CSC format to a matrix in CSR format.
 
int z_spmConvertCSC2IJV (spmatrix_t *spm)
 Convert a matrix in CSC format to a matrix in IJV format.
 
int z_spmConvertCSR2CSC (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in CSC format.
 
int z_spmConvertCSR2IJV (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in IJV format.
 
int z_spmConvertIJV2CSC (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSC format.
 
int z_spmConvertIJV2CSR (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSR format.
 
void z_spm2dense (const spmatrix_t *spm, spm_complex64_t *A)
 Convert a sparse matrix into a dense matrix.
 
int p_spmConvertCSC2CSR (spmatrix_t *spm)
 Conversion routines.
 
int p_spmConvertCSC2IJV (spmatrix_t *spm)
 Convert a matrix in CSC format to a matrix in IJV format.
 
int p_spmConvertCSR2CSC (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in CSC format.
 
int p_spmConvertCSR2IJV (spmatrix_t *spm)
 convert a matrix in CSR format to a matrix in IJV format.
 
int p_spmConvertIJV2CSC (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSC format.
 
int p_spmConvertIJV2CSR (spmatrix_t *spm)
 convert a matrix in IJV format to a matrix in CSR format.
 
static void c_spm_2dense_elt_sym_diag (spm_int_t row, spm_int_t dofi, spm_cconj_fct_t conjfct, const spm_complex32_t *valptr, spm_complex32_t *A, spm_int_t lda)
 Convert to dense a diagonal element within a symmetric/hermitian matrix with column/row major storage.
 
static void c_spm_2dense_elt_gen_col (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_cconj_fct_t conjfct, const spm_complex32_t *valptr, spm_complex32_t *A, const spm_int_t lda)
 Convert to dense a general element matrix with column major storage.
 
static void c_spm_2dense_elt_gen_row (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_cconj_fct_t conjfct, const spm_complex32_t *valptr, spm_complex32_t *A, const spm_int_t lda)
 Convert to dense a general element matrix with row major storage.
 
static void c_spm_2dense_elt_gen (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_cconj_fct_t conjfct, const spm_complex32_t *valptr, spm_complex32_t *A, const spm_int_t lda)
 Convert to dense a general element matrix.
 
static void c_spm_2dense_elt_sym_offd (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_cconj_fct_t conjfct, const spm_complex32_t *valptr, spm_complex32_t *A, const spm_int_t lda)
 Convert to dense an off-diagonal element matrix in the symmetric/hermitian case.
 
static void c_spm_2dense_elt (const spm_mtxtype_t mtxtype, const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_complex32_t *valptr, spm_complex32_t *A, const spm_int_t lda)
 Convert to dense an element matrix.
 
static void c_spmCSC2dense (const spmatrix_t *spm, spm_complex32_t *A)
 Convert a CSC matrix into a dense matrix.
 
static void c_spmCSR2dense (const spmatrix_t *spm, spm_complex32_t *A)
 Convert a CSR matrix into a dense matrix.
 
static void c_spmIJV2dense (const spmatrix_t *spm, spm_complex32_t *A)
 Convert a IJV matrix into a dense matrix.
 
static void s_spm_2dense_elt_sym_diag (spm_int_t row, spm_int_t dofi, spm_sconj_fct_t conjfct, const float *valptr, float *A, spm_int_t lda)
 Convert to dense a diagonal element within a symmetric/symmetric matrix with column/row major storage.
 
static void s_spm_2dense_elt_gen_col (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_sconj_fct_t conjfct, const float *valptr, float *A, const spm_int_t lda)
 Convert to dense a general element matrix with column major storage.
 
static void s_spm_2dense_elt_gen_row (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_sconj_fct_t conjfct, const float *valptr, float *A, const spm_int_t lda)
 Convert to dense a general element matrix with row major storage.
 
static void s_spm_2dense_elt_gen (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_sconj_fct_t conjfct, const float *valptr, float *A, const spm_int_t lda)
 Convert to dense a general element matrix.
 
static void s_spm_2dense_elt_sym_offd (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_sconj_fct_t conjfct, const float *valptr, float *A, const spm_int_t lda)
 Convert to dense an off-diagonal element matrix in the symmetric/symmetric case.
 
static void s_spm_2dense_elt (const spm_mtxtype_t mtxtype, const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const float *valptr, float *A, const spm_int_t lda)
 Convert to dense an element matrix.
 
static void s_spmCSC2dense (const spmatrix_t *spm, float *A)
 Convert a CSC matrix into a dense matrix.
 
static void s_spmCSR2dense (const spmatrix_t *spm, float *A)
 Convert a CSR matrix into a dense matrix.
 
static void s_spmIJV2dense (const spmatrix_t *spm, float *A)
 Convert a IJV matrix into a dense matrix.
 
static void z_spm_2dense_elt_sym_diag (spm_int_t row, spm_int_t dofi, spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, spm_int_t lda)
 Convert to dense a diagonal element within a symmetric/hermitian matrix with column/row major storage.
 
static void z_spm_2dense_elt_gen_col (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
 Convert to dense a general element matrix with column major storage.
 
static void z_spm_2dense_elt_gen_row (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
 Convert to dense a general element matrix with row major storage.
 
static void z_spm_2dense_elt_gen (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
 Convert to dense a general element matrix.
 
static void z_spm_2dense_elt_sym_offd (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_zconj_fct_t conjfct, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
 Convert to dense an off-diagonal element matrix in the symmetric/hermitian case.
 
static void z_spm_2dense_elt (const spm_mtxtype_t mtxtype, const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_complex64_t *valptr, spm_complex64_t *A, const spm_int_t lda)
 Convert to dense an element matrix.
 
static void z_spmCSC2dense (const spmatrix_t *spm, spm_complex64_t *A)
 Convert a CSC matrix into a dense matrix.
 
static void z_spmCSR2dense (const spmatrix_t *spm, spm_complex64_t *A)
 Convert a CSR matrix into a dense matrix.
 
static void z_spmIJV2dense (const spmatrix_t *spm, spm_complex64_t *A)
 Convert a IJV matrix into a dense matrix.
 
static void d_spm_2dense_elt_sym_diag (spm_int_t row, spm_int_t dofi, spm_dconj_fct_t conjfct, const double *valptr, double *A, spm_int_t lda)
 Convert to dense a diagonal element within a symmetric/symmetric matrix with column/row major storage.
 
static void d_spm_2dense_elt_gen_col (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_dconj_fct_t conjfct, const double *valptr, double *A, const spm_int_t lda)
 Convert to dense a general element matrix with column major storage.
 
static void d_spm_2dense_elt_gen_row (const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_dconj_fct_t conjfct, const double *valptr, double *A, const spm_int_t lda)
 Convert to dense a general element matrix with row major storage.
 
static void d_spm_2dense_elt_gen (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_dconj_fct_t conjfct, const double *valptr, double *A, const spm_int_t lda)
 Convert to dense a general element matrix.
 
static void d_spm_2dense_elt_sym_offd (const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const spm_dconj_fct_t conjfct, const double *valptr, double *A, const spm_int_t lda)
 Convert to dense an off-diagonal element matrix in the symmetric/symmetric case.
 
static void d_spm_2dense_elt (const spm_mtxtype_t mtxtype, const spm_layout_t layout, const spm_int_t row, const spm_int_t dofi, const spm_int_t col, const spm_int_t dofj, const double *valptr, double *A, const spm_int_t lda)
 Convert to dense an element matrix.
 
static void d_spmCSC2dense (const spmatrix_t *spm, double *A)
 Convert a CSC matrix into a dense matrix.
 
static void d_spmCSR2dense (const spmatrix_t *spm, double *A)
 Convert a CSR matrix into a dense matrix.
 
static void d_spmIJV2dense (const spmatrix_t *spm, double *A)
 Convert a IJV matrix into a dense matrix.
 
static int d_spmConvertCSR2CSC_sym (spmatrix_t *spm)
 convert a symmetric matrix in CSR format to a matrix in CSC format.
 
static int d_spmConvertCSR2CSC_gen (spmatrix_t *spm)
 convert a general matrix in CSR format to a matrix in CSC format.
 
static int c_spmConvertCSR2CSC_sym (spmatrix_t *spm)
 convert a symmetric matrix in CSR format to a matrix in CSC format.
 
static int c_spmConvertCSR2CSC_gen (spmatrix_t *spm)
 convert a general matrix in CSR format to a matrix in CSC format.
 
static int p_spmConvertCSR2CSC_sym (spmatrix_t *spm)
 convert a symmetric matrix in CSR format to a matrix in CSC format.
 
static int p_spmConvertCSR2CSC_gen (spmatrix_t *spm)
 convert a general matrix in CSR format to a matrix in CSC format.
 
static int s_spmConvertCSR2CSC_sym (spmatrix_t *spm)
 convert a symmetric matrix in CSR format to a matrix in CSC format.
 
static int s_spmConvertCSR2CSC_gen (spmatrix_t *spm)
 convert a general matrix in CSR format to a matrix in CSC format.
 
static int z_spmConvertCSR2CSC_sym (spmatrix_t *spm)
 convert a symmetric matrix in CSR format to a matrix in CSC format.
 
static int z_spmConvertCSR2CSC_gen (spmatrix_t *spm)
 convert a general matrix in CSR format to a matrix in CSC format.
 

Detailed Description

Conversion routines.

Function Documentation

◆ s_spmConvertCSC2CSR()

int s_spmConvertCSC2CSR ( spmatrix_t spm)

convert a matrix in CSC format to a matrix in CSR format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csc matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESS

Definition at line 86 of file s_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, s_spmConvertCSR2CSC(), and SpmCSR.

◆ s_spmConvertCSC2IJV()

int s_spmConvertCSC2IJV ( spmatrix_t spm)

Convert a matrix in CSC format to a matrix in IJV format.

Parameters
[in,out]spmThe csc matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 39 of file s_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmIJV.

◆ s_spmConvertCSR2CSC()

int s_spmConvertCSR2CSC ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in CSC format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csr matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESS

Definition at line 724 of file s_spm_convert_to_csc.c.

References spmatrix_s::fmttype, spmatrix_s::mtxtype, s_spmConvertCSR2CSC_gen(), s_spmConvertCSR2CSC_sym(), SPM_ERR_UNKNOWN, SpmCSR, SpmGeneral, and SpmSymmetric.

Referenced by s_spmConvertCSC2CSR().

◆ s_spmConvertCSR2IJV()

int s_spmConvertCSR2IJV ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in IJV format.

Parameters
[in,out]spmThe csr matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 108 of file s_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_SUCCESS, and SpmIJV.

◆ s_spmConvertIJV2CSC()

int s_spmConvertIJV2CSC ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSC format.

Parameters
[in,out]spmThe ijv matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 347 of file s_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, s_spmSort(), SPM_SUCCESS, and SpmCSC.

Referenced by s_spmConvertIJV2CSR().

◆ s_spmConvertIJV2CSR()

int s_spmConvertIJV2CSR ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSR format.

Parameters
[in,out]spmThe ijv matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 42 of file s_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, s_spmConvertIJV2CSC(), and SpmCSR.

◆ s_spm2dense()

void s_spm2dense ( const spmatrix_t spm,
float *  A 
)

Convert a sparse matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Remarks
DO NOT USE with large matrices. This is for test purpose only.
Parameters
[in]spmThe sparse matrix to convert to dense format.
[in,out]AOn entry, an allocated matrix of size spm->gNexp-by-spm->gNexp. On exit, the matrix A is set to the sparse matrix spm.

Definition at line 672 of file s_spm_2dense.c.

References spmatrix_s::fmttype, spmatrix_s::replicated, s_spmCSC2dense(), s_spmCSR2dense(), s_spmIJV2dense(), SpmCSC, SpmCSR, and SpmIJV.

Referenced by spm2Dense().

◆ d_spmConvertCSC2CSR()

int d_spmConvertCSC2CSR ( spmatrix_t spm)

convert a matrix in CSC format to a matrix in CSR format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csc matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESS

Definition at line 86 of file d_spm_convert_to_csr.c.

References spmatrix_s::colptr, d_spmConvertCSR2CSC(), spmatrix_s::fmttype, spmatrix_s::rowptr, and SpmCSR.

◆ d_spmConvertCSC2IJV()

int d_spmConvertCSC2IJV ( spmatrix_t spm)

Convert a matrix in CSC format to a matrix in IJV format.

Parameters
[in,out]spmThe csc matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 39 of file d_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmIJV.

◆ d_spmConvertCSR2CSC()

int d_spmConvertCSR2CSC ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in CSC format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csr matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESS

Definition at line 724 of file d_spm_convert_to_csc.c.

References d_spmConvertCSR2CSC_gen(), d_spmConvertCSR2CSC_sym(), spmatrix_s::fmttype, spmatrix_s::mtxtype, SPM_ERR_UNKNOWN, SpmCSR, SpmGeneral, and SpmSymmetric.

Referenced by d_spmConvertCSC2CSR().

◆ d_spmConvertCSR2IJV()

int d_spmConvertCSR2IJV ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in IJV format.

Parameters
[in,out]spmThe csr matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 108 of file d_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_SUCCESS, and SpmIJV.

◆ d_spmConvertIJV2CSC()

int d_spmConvertIJV2CSC ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSC format.

Parameters
[in,out]spmThe ijv matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 347 of file d_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, d_spmSort(), spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmCSC.

Referenced by d_spmConvertIJV2CSR().

◆ d_spmConvertIJV2CSR()

int d_spmConvertIJV2CSR ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSR format.

Parameters
[in,out]spmThe ijv matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 42 of file d_spm_convert_to_csr.c.

References spmatrix_s::colptr, d_spmConvertIJV2CSC(), spmatrix_s::fmttype, spmatrix_s::rowptr, and SpmCSR.

◆ d_spm2dense()

void d_spm2dense ( const spmatrix_t spm,
double *  A 
)

Convert a sparse matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Remarks
DO NOT USE with large matrices. This is for test purpose only.
Parameters
[in]spmThe sparse matrix to convert to dense format.
[in,out]AOn entry, an allocated matrix of size spm->gNexp-by-spm->gNexp. On exit, the matrix A is set to the sparse matrix spm.

Definition at line 672 of file d_spm_2dense.c.

References d_spmCSC2dense(), d_spmCSR2dense(), d_spmIJV2dense(), spmatrix_s::fmttype, spmatrix_s::replicated, SpmCSC, SpmCSR, and SpmIJV.

Referenced by spm2Dense().

◆ c_spmConvertCSC2CSR()

int c_spmConvertCSC2CSR ( spmatrix_t spm)

convert a matrix in CSC format to a matrix in CSR format.

If the matrix is SpmSymmetric or SpmHermitian, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csc matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESS

Definition at line 86 of file c_spm_convert_to_csr.c.

References c_spmConvertCSR2CSC(), spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, and SpmCSR.

◆ c_spmConvertCSC2IJV()

int c_spmConvertCSC2IJV ( spmatrix_t spm)

Convert a matrix in CSC format to a matrix in IJV format.

Parameters
[in,out]spmThe csc matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 39 of file c_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmIJV.

◆ c_spmConvertCSR2CSC()

int c_spmConvertCSR2CSC ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in CSC format.

If the matrix is SpmSymmetric or SpmHermitian, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csr matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESS

Definition at line 724 of file c_spm_convert_to_csc.c.

References c_spmConvertCSR2CSC_gen(), c_spmConvertCSR2CSC_sym(), spmatrix_s::fmttype, spmatrix_s::mtxtype, SPM_ERR_UNKNOWN, SpmCSR, SpmGeneral, SpmHermitian, and SpmSymmetric.

Referenced by c_spmConvertCSC2CSR().

◆ c_spmConvertCSR2IJV()

int c_spmConvertCSR2IJV ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in IJV format.

Parameters
[in,out]spmThe csr matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 108 of file c_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_SUCCESS, and SpmIJV.

◆ c_spmConvertIJV2CSC()

int c_spmConvertIJV2CSC ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSC format.

Parameters
[in,out]spmThe ijv matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 347 of file c_spm_convert_to_csc.c.

References spmatrix_s::baseval, c_spmSort(), spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmCSC.

Referenced by c_spmConvertIJV2CSR().

◆ c_spmConvertIJV2CSR()

int c_spmConvertIJV2CSR ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSR format.

Parameters
[in,out]spmThe ijv matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 42 of file c_spm_convert_to_csr.c.

References c_spmConvertIJV2CSC(), spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, and SpmCSR.

◆ c_spm2dense()

void c_spm2dense ( const spmatrix_t spm,
spm_complex32_t A 
)

Convert a sparse matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Remarks
DO NOT USE with large matrices. This is for test purpose only.
Parameters
[in]spmThe sparse matrix to convert to dense format.
[in,out]AOn entry, an allocated matrix of size spm->gNexp-by-spm->gNexp. On exit, the matrix A is set to the sparse matrix spm.

Definition at line 672 of file c_spm_2dense.c.

References c_spmCSC2dense(), c_spmCSR2dense(), c_spmIJV2dense(), spmatrix_s::fmttype, spmatrix_s::replicated, SpmCSC, SpmCSR, and SpmIJV.

Referenced by spm2Dense().

◆ z_spmConvertCSC2CSR()

int z_spmConvertCSC2CSR ( spmatrix_t spm)

convert a matrix in CSC format to a matrix in CSR format.

If the matrix is SpmSymmetric or SpmHermitian, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csc matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESS

Definition at line 86 of file z_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SpmCSR, and z_spmConvertCSR2CSC().

◆ z_spmConvertCSC2IJV()

int z_spmConvertCSC2IJV ( spmatrix_t spm)

Convert a matrix in CSC format to a matrix in IJV format.

Parameters
[in,out]spmThe csc matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 39 of file z_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmIJV.

◆ z_spmConvertCSR2CSC()

int z_spmConvertCSR2CSC ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in CSC format.

If the matrix is SpmSymmetric or SpmHermitian, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csr matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESS

Definition at line 724 of file z_spm_convert_to_csc.c.

References spmatrix_s::fmttype, spmatrix_s::mtxtype, SPM_ERR_UNKNOWN, SpmCSR, SpmGeneral, SpmHermitian, SpmSymmetric, z_spmConvertCSR2CSC_gen(), and z_spmConvertCSR2CSC_sym().

Referenced by z_spmConvertCSC2CSR().

◆ z_spmConvertCSR2IJV()

int z_spmConvertCSR2IJV ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in IJV format.

Parameters
[in,out]spmThe csr matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 108 of file z_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_SUCCESS, and SpmIJV.

◆ z_spmConvertIJV2CSC()

int z_spmConvertIJV2CSC ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSC format.

Parameters
[in,out]spmThe ijv matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 347 of file z_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, SpmCSC, and z_spmSort().

Referenced by z_spmConvertIJV2CSR().

◆ z_spmConvertIJV2CSR()

int z_spmConvertIJV2CSR ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSR format.

Parameters
[in,out]spmThe ijv matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 42 of file z_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SpmCSR, and z_spmConvertIJV2CSC().

◆ z_spm2dense()

void z_spm2dense ( const spmatrix_t spm,
spm_complex64_t *  A 
)

Convert a sparse matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Remarks
DO NOT USE with large matrices. This is for test purpose only.
Parameters
[in]spmThe sparse matrix to convert to dense format.
[in,out]AOn entry, an allocated matrix of size spm->gNexp-by-spm->gNexp. On exit, the matrix A is set to the sparse matrix spm.

Definition at line 672 of file z_spm_2dense.c.

References spmatrix_s::fmttype, spmatrix_s::replicated, SpmCSC, SpmCSR, SpmIJV, z_spmCSC2dense(), z_spmCSR2dense(), and z_spmIJV2dense().

Referenced by spm2Dense().

◆ p_spmConvertCSC2CSR()

int p_spmConvertCSC2CSR ( spmatrix_t spm)

Conversion routines.

convert a matrix in CSC format to a matrix in CSR format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csc matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESS

Definition at line 86 of file p_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, p_spmConvertCSR2CSC(), spmatrix_s::rowptr, and SpmCSR.

◆ p_spmConvertCSC2IJV()

int p_spmConvertCSC2IJV ( spmatrix_t spm)

Convert a matrix in CSC format to a matrix in IJV format.

Parameters
[in,out]spmThe csc matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 39 of file p_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, SPM_SUCCESS, and SpmIJV.

◆ p_spmConvertCSR2CSC()

int p_spmConvertCSR2CSC ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in CSC format.

If the matrix is SpmSymmetric or SpmSymmetric, then the transpose or respectively the conjugate is returned.

Parameters
[in,out]spmThe csr matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESS

Definition at line 724 of file p_spm_convert_to_csc.c.

References spmatrix_s::fmttype, spmatrix_s::mtxtype, p_spmConvertCSR2CSC_gen(), p_spmConvertCSR2CSC_sym(), SPM_ERR_UNKNOWN, SpmCSR, SpmGeneral, and SpmSymmetric.

Referenced by p_spmConvertCSC2CSR().

◆ p_spmConvertCSR2IJV()

int p_spmConvertCSR2IJV ( spmatrix_t spm)

convert a matrix in CSR format to a matrix in IJV format.

Parameters
[in,out]spmThe csr matrix at enter, the ijv matrix at exit.
Return values
SPM_SUCCESS

Definition at line 108 of file p_spm_convert_to_ijv.c.

References spmatrix_s::baseval, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_SUCCESS, and SpmIJV.

◆ p_spmConvertIJV2CSC()

int p_spmConvertIJV2CSC ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSC format.

Parameters
[in,out]spmThe ijv matrix at enter, the csc matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 347 of file p_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, p_spmSort(), spmatrix_s::replicated, SPM_SUCCESS, and SpmCSC.

Referenced by p_spmConvertIJV2CSR().

◆ p_spmConvertIJV2CSR()

int p_spmConvertIJV2CSR ( spmatrix_t spm)

convert a matrix in IJV format to a matrix in CSR format.

Parameters
[in,out]spmThe ijv matrix at enter, the csr matrix at exit.
Return values
SPM_SUCCESSon success
SPM_ERR_NOTIMPLEMENTEDon non supported cases

Definition at line 42 of file p_spm_convert_to_csr.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, p_spmConvertIJV2CSC(), spmatrix_s::rowptr, and SpmCSR.

◆ c_spm_2dense_elt_sym_diag()

static void c_spm_2dense_elt_sym_diag ( spm_int_t  row,
spm_int_t  dofi,
spm_cconj_fct_t  conjfct,
const spm_complex32_t valptr,
spm_complex32_t A,
spm_int_t  lda 
)
static

Convert to dense a diagonal element within a symmetric/hermitian matrix with column/row major storage.

Note that column major is using the low triangular part only of the diagonal element matrices, and row major, by symmetry, is using only the upper triangular part.

The comments in the code are made for column major storage.

Parameters
[in]rowThe row (and column) index of the diagonal element matrix in the expended dense matrix
[in]dofiThe size of the element matrix dofi -by- dofi
[in]conjfctThe op() function to apply to each element among id() or conjf()
[in]valptrThe element matrix of size dofi-by-dofi
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 60 of file c_spm_2dense.c.

Referenced by c_spm_2dense_elt().

◆ c_spm_2dense_elt_gen_col()

static void c_spm_2dense_elt_gen_col ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_cconj_fct_t  conjfct,
const spm_complex32_t valptr,
spm_complex32_t A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with column major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conjf()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 128 of file c_spm_2dense.c.

Referenced by c_spm_2dense_elt_gen(), and c_spm_2dense_elt_sym_offd().

◆ c_spm_2dense_elt_gen_row()

static void c_spm_2dense_elt_gen_row ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_cconj_fct_t  conjfct,
const spm_complex32_t valptr,
spm_complex32_t A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with row major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conjf()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 185 of file c_spm_2dense.c.

Referenced by c_spm_2dense_elt_gen(), and c_spm_2dense_elt_sym_offd().

◆ c_spm_2dense_elt_gen()

static void c_spm_2dense_elt_gen ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_cconj_fct_t  conjfct,
const spm_complex32_t valptr,
spm_complex32_t A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conjf()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 246 of file c_spm_2dense.c.

References c_spm_2dense_elt_gen_col(), c_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by c_spm_2dense_elt().

◆ c_spm_2dense_elt_sym_offd()

static void c_spm_2dense_elt_sym_offd ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_cconj_fct_t  conjfct,
const spm_complex32_t valptr,
spm_complex32_t A,
const spm_int_t  lda 
)
static

Convert to dense an off-diagonal element matrix in the symmetric/hermitian case.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conjf()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 306 of file c_spm_2dense.c.

References c_spm_2dense_elt_gen_col(), c_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by c_spm_2dense_elt().

◆ c_spm_2dense_elt()

static void c_spm_2dense_elt ( const spm_mtxtype_t  mtxtype,
const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_complex32_t valptr,
spm_complex32_t A,
const spm_int_t  lda 
)
static

Convert to dense an element matrix.

Parameters
[in]mtxtypeDefine the matrix type
  • SpmGeneral if spm is general
  • SpmSymmetric if spm is symmetric
  • SpmHermitian if spm is hermitian
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 375 of file c_spm_2dense.c.

References c_spm_2dense_elt_gen(), c_spm_2dense_elt_sym_diag(), c_spm_2dense_elt_sym_offd(), SpmGeneral, and SpmHermitian.

Referenced by c_spmCSC2dense(), c_spmCSR2dense(), and c_spmIJV2dense().

◆ c_spmCSC2dense()

static void c_spmCSC2dense ( const spmatrix_t spm,
spm_complex32_t A 
)
static

Convert a CSC matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSC format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 433 of file c_spm_2dense.c.

References spmatrix_s::baseval, c_spm_2dense_elt(), spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmComplex32, SpmCSC, and spmatrix_s::values.

Referenced by c_spm2dense().

◆ c_spmCSR2dense()

static void c_spmCSR2dense ( const spmatrix_t spm,
spm_complex32_t A 
)
static

Convert a CSR matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSR format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 515 of file c_spm_2dense.c.

References spmatrix_s::baseval, c_spm_2dense_elt(), spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmComplex32, SpmCSR, and spmatrix_s::values.

Referenced by c_spm2dense().

◆ c_spmIJV2dense()

static void c_spmIJV2dense ( const spmatrix_t spm,
spm_complex32_t A 
)
static

Convert a IJV matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the IJV format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 597 of file c_spm_2dense.c.

References spmatrix_s::baseval, c_spm_2dense_elt(), spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::mtxtype, spmatrix_s::nnz, spmatrix_s::rowptr, SpmComplex32, SpmIJV, and spmatrix_s::values.

Referenced by c_spm2dense().

◆ s_spm_2dense_elt_sym_diag()

static void s_spm_2dense_elt_sym_diag ( spm_int_t  row,
spm_int_t  dofi,
spm_sconj_fct_t  conjfct,
const float *  valptr,
float *  A,
spm_int_t  lda 
)
static

Convert to dense a diagonal element within a symmetric/symmetric matrix with column/row major storage.

Note that column major is using the low triangular part only of the diagonal element matrices, and row major, by symmetry, is using only the upper triangular part.

The comments in the code are made for column major storage.

Parameters
[in]rowThe row (and column) index of the diagonal element matrix in the expended dense matrix
[in]dofiThe size of the element matrix dofi -by- dofi
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofi
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 60 of file s_spm_2dense.c.

Referenced by s_spm_2dense_elt().

◆ s_spm_2dense_elt_gen_col()

static void s_spm_2dense_elt_gen_col ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_sconj_fct_t  conjfct,
const float *  valptr,
float *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with column major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 128 of file s_spm_2dense.c.

Referenced by s_spm_2dense_elt_gen(), and s_spm_2dense_elt_sym_offd().

◆ s_spm_2dense_elt_gen_row()

static void s_spm_2dense_elt_gen_row ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_sconj_fct_t  conjfct,
const float *  valptr,
float *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with row major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 185 of file s_spm_2dense.c.

Referenced by s_spm_2dense_elt_gen(), and s_spm_2dense_elt_sym_offd().

◆ s_spm_2dense_elt_gen()

static void s_spm_2dense_elt_gen ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_sconj_fct_t  conjfct,
const float *  valptr,
float *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 246 of file s_spm_2dense.c.

References s_spm_2dense_elt_gen_col(), s_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by s_spm_2dense_elt().

◆ s_spm_2dense_elt_sym_offd()

static void s_spm_2dense_elt_sym_offd ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_sconj_fct_t  conjfct,
const float *  valptr,
float *  A,
const spm_int_t  lda 
)
static

Convert to dense an off-diagonal element matrix in the symmetric/symmetric case.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 306 of file s_spm_2dense.c.

References s_spm_2dense_elt_gen_col(), s_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by s_spm_2dense_elt().

◆ s_spm_2dense_elt()

static void s_spm_2dense_elt ( const spm_mtxtype_t  mtxtype,
const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const float *  valptr,
float *  A,
const spm_int_t  lda 
)
static

Convert to dense an element matrix.

Parameters
[in]mtxtypeDefine the matrix type
  • SpmGeneral if spm is general
  • SpmSymmetric if spm is symmetric
  • SpmSymmetric if spm is symmetric
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 375 of file s_spm_2dense.c.

References s_spm_2dense_elt_gen(), s_spm_2dense_elt_sym_diag(), s_spm_2dense_elt_sym_offd(), SpmGeneral, and SpmSymmetric.

Referenced by s_spmCSC2dense(), s_spmCSR2dense(), and s_spmIJV2dense().

◆ s_spmCSC2dense()

static void s_spmCSC2dense ( const spmatrix_t spm,
float *  A 
)
static

Convert a CSC matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSC format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 433 of file s_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, s_spm_2dense_elt(), SpmCSC, SpmFloat, and spmatrix_s::values.

Referenced by s_spm2dense().

◆ s_spmCSR2dense()

static void s_spmCSR2dense ( const spmatrix_t spm,
float *  A 
)
static

Convert a CSR matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSR format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 515 of file s_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, s_spm_2dense_elt(), SpmCSR, SpmFloat, and spmatrix_s::values.

Referenced by s_spm2dense().

◆ s_spmIJV2dense()

static void s_spmIJV2dense ( const spmatrix_t spm,
float *  A 
)
static

Convert a IJV matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the IJV format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 597 of file s_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::mtxtype, spmatrix_s::nnz, spmatrix_s::rowptr, s_spm_2dense_elt(), SpmFloat, SpmIJV, and spmatrix_s::values.

Referenced by s_spm2dense().

◆ z_spm_2dense_elt_sym_diag()

static void z_spm_2dense_elt_sym_diag ( spm_int_t  row,
spm_int_t  dofi,
spm_zconj_fct_t  conjfct,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
spm_int_t  lda 
)
static

Convert to dense a diagonal element within a symmetric/hermitian matrix with column/row major storage.

Note that column major is using the low triangular part only of the diagonal element matrices, and row major, by symmetry, is using only the upper triangular part.

The comments in the code are made for column major storage.

Parameters
[in]rowThe row (and column) index of the diagonal element matrix in the expended dense matrix
[in]dofiThe size of the element matrix dofi -by- dofi
[in]conjfctThe op() function to apply to each element among id() or conj()
[in]valptrThe element matrix of size dofi-by-dofi
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 60 of file z_spm_2dense.c.

Referenced by z_spm_2dense_elt().

◆ z_spm_2dense_elt_gen_col()

static void z_spm_2dense_elt_gen_col ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_zconj_fct_t  conjfct,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with column major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conj()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 128 of file z_spm_2dense.c.

Referenced by z_spm_2dense_elt_gen(), and z_spm_2dense_elt_sym_offd().

◆ z_spm_2dense_elt_gen_row()

static void z_spm_2dense_elt_gen_row ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_zconj_fct_t  conjfct,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with row major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conj()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 185 of file z_spm_2dense.c.

Referenced by z_spm_2dense_elt_gen(), and z_spm_2dense_elt_sym_offd().

◆ z_spm_2dense_elt_gen()

static void z_spm_2dense_elt_gen ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_zconj_fct_t  conjfct,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conj()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 246 of file z_spm_2dense.c.

References SpmColMajor, z_spm_2dense_elt_gen_col(), and z_spm_2dense_elt_gen_row().

Referenced by z_spm_2dense_elt().

◆ z_spm_2dense_elt_sym_offd()

static void z_spm_2dense_elt_sym_offd ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_zconj_fct_t  conjfct,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
const spm_int_t  lda 
)
static

Convert to dense an off-diagonal element matrix in the symmetric/hermitian case.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or conj()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 306 of file z_spm_2dense.c.

References SpmColMajor, z_spm_2dense_elt_gen_col(), and z_spm_2dense_elt_gen_row().

Referenced by z_spm_2dense_elt().

◆ z_spm_2dense_elt()

static void z_spm_2dense_elt ( const spm_mtxtype_t  mtxtype,
const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_complex64_t *  valptr,
spm_complex64_t *  A,
const spm_int_t  lda 
)
static

Convert to dense an element matrix.

Parameters
[in]mtxtypeDefine the matrix type
  • SpmGeneral if spm is general
  • SpmSymmetric if spm is symmetric
  • SpmHermitian if spm is hermitian
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 375 of file z_spm_2dense.c.

References SpmGeneral, SpmHermitian, z_spm_2dense_elt_gen(), z_spm_2dense_elt_sym_diag(), and z_spm_2dense_elt_sym_offd().

Referenced by z_spmCSC2dense(), z_spmCSR2dense(), and z_spmIJV2dense().

◆ z_spmCSC2dense()

static void z_spmCSC2dense ( const spmatrix_t spm,
spm_complex64_t *  A 
)
static

Convert a CSC matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSC format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 433 of file z_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmComplex64, SpmCSC, spmatrix_s::values, and z_spm_2dense_elt().

Referenced by z_spm2dense().

◆ z_spmCSR2dense()

static void z_spmCSR2dense ( const spmatrix_t spm,
spm_complex64_t *  A 
)
static

Convert a CSR matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSR format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 515 of file z_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmComplex64, SpmCSR, spmatrix_s::values, and z_spm_2dense_elt().

Referenced by z_spm2dense().

◆ z_spmIJV2dense()

static void z_spmIJV2dense ( const spmatrix_t spm,
spm_complex64_t *  A 
)
static

Convert a IJV matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is hermitian or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the IJV format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 597 of file z_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::mtxtype, spmatrix_s::nnz, spmatrix_s::rowptr, SpmComplex64, SpmIJV, spmatrix_s::values, and z_spm_2dense_elt().

Referenced by z_spm2dense().

◆ d_spm_2dense_elt_sym_diag()

static void d_spm_2dense_elt_sym_diag ( spm_int_t  row,
spm_int_t  dofi,
spm_dconj_fct_t  conjfct,
const double *  valptr,
double *  A,
spm_int_t  lda 
)
static

Convert to dense a diagonal element within a symmetric/symmetric matrix with column/row major storage.

Note that column major is using the low triangular part only of the diagonal element matrices, and row major, by symmetry, is using only the upper triangular part.

The comments in the code are made for column major storage.

Parameters
[in]rowThe row (and column) index of the diagonal element matrix in the expended dense matrix
[in]dofiThe size of the element matrix dofi -by- dofi
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofi
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 60 of file d_spm_2dense.c.

Referenced by d_spm_2dense_elt().

◆ d_spm_2dense_elt_gen_col()

static void d_spm_2dense_elt_gen_col ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_dconj_fct_t  conjfct,
const double *  valptr,
double *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with column major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 128 of file d_spm_2dense.c.

Referenced by d_spm_2dense_elt_gen(), and d_spm_2dense_elt_sym_offd().

◆ d_spm_2dense_elt_gen_row()

static void d_spm_2dense_elt_gen_row ( const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_dconj_fct_t  conjfct,
const double *  valptr,
double *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix with row major storage.

Parameters
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 185 of file d_spm_2dense.c.

Referenced by d_spm_2dense_elt_gen(), and d_spm_2dense_elt_sym_offd().

◆ d_spm_2dense_elt_gen()

static void d_spm_2dense_elt_gen ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_dconj_fct_t  conjfct,
const double *  valptr,
double *  A,
const spm_int_t  lda 
)
static

Convert to dense a general element matrix.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 246 of file d_spm_2dense.c.

References d_spm_2dense_elt_gen_col(), d_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by d_spm_2dense_elt().

◆ d_spm_2dense_elt_sym_offd()

static void d_spm_2dense_elt_sym_offd ( const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const spm_dconj_fct_t  conjfct,
const double *  valptr,
double *  A,
const spm_int_t  lda 
)
static

Convert to dense an off-diagonal element matrix in the symmetric/symmetric case.

Parameters
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]conjfctThe op() function to apply to each element among id() or ()
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 306 of file d_spm_2dense.c.

References d_spm_2dense_elt_gen_col(), d_spm_2dense_elt_gen_row(), and SpmColMajor.

Referenced by d_spm_2dense_elt().

◆ d_spm_2dense_elt()

static void d_spm_2dense_elt ( const spm_mtxtype_t  mtxtype,
const spm_layout_t  layout,
const spm_int_t  row,
const spm_int_t  dofi,
const spm_int_t  col,
const spm_int_t  dofj,
const double *  valptr,
double *  A,
const spm_int_t  lda 
)
static

Convert to dense an element matrix.

Parameters
[in]mtxtypeDefine the matrix type
  • SpmGeneral if spm is general
  • SpmSymmetric if spm is symmetric
  • SpmSymmetric if spm is symmetric
[in]layout
  • SpmColMajor if valptr is stored in column major mode.
  • SpmRowMajor if valptr is stored in row major mode.
[in]rowThe row index of the element matrix in the expended dense matrix.
[in]dofiThe number of rows of the element matrix valptr
[in]colThe column index of the element matrix in the expended dense matrix.
[in]dofjThe number of columns of the element matrix valptr
[in]valptrThe element matrix of size dofi-by-dofj
[out]AThe reference dense matrix in which to copy the sparse one.
[in]ldathe leading dimension of the matrix A.

Definition at line 375 of file d_spm_2dense.c.

References d_spm_2dense_elt_gen(), d_spm_2dense_elt_sym_diag(), d_spm_2dense_elt_sym_offd(), SpmGeneral, and SpmSymmetric.

Referenced by d_spmCSC2dense(), d_spmCSR2dense(), and d_spmIJV2dense().

◆ d_spmCSC2dense()

static void d_spmCSC2dense ( const spmatrix_t spm,
double *  A 
)
static

Convert a CSC matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSC format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 433 of file d_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, d_spm_2dense_elt(), spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmCSC, SpmDouble, and spmatrix_s::values.

Referenced by d_spm2dense().

◆ d_spmCSR2dense()

static void d_spmCSR2dense ( const spmatrix_t spm,
double *  A 
)
static

Convert a CSR matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the CSR format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 515 of file d_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, d_spm_2dense_elt(), spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::loc2glob, spmatrix_s::mtxtype, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, SpmCSR, SpmDouble, and spmatrix_s::values.

Referenced by d_spm2dense().

◆ d_spmIJV2dense()

static void d_spmIJV2dense ( const spmatrix_t spm,
double *  A 
)
static

Convert a IJV matrix into a dense matrix.

The denses matrix is initialized with zeroes and filled with the spm matrix values. When the matrix is symmetric or symmetric, both sides (upper and lower) of the dense matrix are initialized.

Parameters
[in]spmThe sparse matrix in the IJV format.
[in,out]AOn entry, the allocated A matrix of size spm->gNexp -by- spm->gNexp. On exit, the A matrix is initialized as the sparse matrix one.

Definition at line 597 of file d_spm_2dense.c.

References spmatrix_s::baseval, spmatrix_s::colptr, d_spm_2dense_elt(), spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::gNexp, spmatrix_s::layout, spmatrix_s::mtxtype, spmatrix_s::nnz, spmatrix_s::rowptr, SpmDouble, SpmIJV, and spmatrix_s::values.

Referenced by d_spm2dense().

◆ d_spmConvertCSR2CSC_sym()

static int d_spmConvertCSR2CSC_sym ( spmatrix_t spm)
static

convert a symmetric matrix in CSR format to a matrix in CSC format.

Note that the transposed matrix is returned.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

Definition at line 413 of file d_spm_convert_to_csc.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SPM_SUCCESS, SpmCSC, and SpmCSR.

Referenced by d_spmConvertCSR2CSC().

◆ d_spmConvertCSR2CSC_gen()

static int d_spmConvertCSR2CSC_gen ( spmatrix_t spm)
static

convert a general matrix in CSR format to a matrix in CSC format.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

If the spm has multidof, we have to recompute the newal array It's done here because we need the new rowptr array

Definition at line 564 of file d_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::gN, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_NOTIMPLEMENTED, spm_get_value_idx_by_elt(), SPM_SUCCESS, SpmCSC, SpmCSR, spmExit(), and spmatrix_s::values.

Referenced by d_spmConvertCSR2CSC().

◆ c_spmConvertCSR2CSC_sym()

static int c_spmConvertCSR2CSC_sym ( spmatrix_t spm)
static

convert a symmetric matrix in CSR format to a matrix in CSC format.

Note that the transposed matrix is returned.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

Definition at line 413 of file c_spm_convert_to_csc.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SPM_SUCCESS, SpmCSC, and SpmCSR.

Referenced by c_spmConvertCSR2CSC().

◆ c_spmConvertCSR2CSC_gen()

static int c_spmConvertCSR2CSC_gen ( spmatrix_t spm)
static

convert a general matrix in CSR format to a matrix in CSC format.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

If the spm has multidof, we have to recompute the newal array It's done here because we need the new rowptr array

Definition at line 564 of file c_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::gN, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_NOTIMPLEMENTED, spm_get_value_idx_by_elt(), SPM_SUCCESS, SpmCSC, SpmCSR, spmExit(), and spmatrix_s::values.

Referenced by c_spmConvertCSR2CSC().

◆ p_spmConvertCSR2CSC_sym()

static int p_spmConvertCSR2CSC_sym ( spmatrix_t spm)
static

convert a symmetric matrix in CSR format to a matrix in CSC format.

Note that the transposed matrix is returned.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

Definition at line 413 of file p_spm_convert_to_csc.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SPM_SUCCESS, SpmCSC, and SpmCSR.

Referenced by p_spmConvertCSR2CSC().

◆ p_spmConvertCSR2CSC_gen()

static int p_spmConvertCSR2CSC_gen ( spmatrix_t spm)
static

convert a general matrix in CSR format to a matrix in CSC format.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

If the spm has multidof, we have to recompute the newal array It's done here because we need the new rowptr array

Definition at line 564 of file p_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::gN, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_NOTIMPLEMENTED, spm_get_value_idx_by_elt(), SPM_SUCCESS, SpmCSC, SpmCSR, spmExit(), and spmatrix_s::values.

Referenced by p_spmConvertCSR2CSC().

◆ s_spmConvertCSR2CSC_sym()

static int s_spmConvertCSR2CSC_sym ( spmatrix_t spm)
static

convert a symmetric matrix in CSR format to a matrix in CSC format.

Note that the transposed matrix is returned.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

Definition at line 413 of file s_spm_convert_to_csc.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SPM_SUCCESS, SpmCSC, and SpmCSR.

Referenced by s_spmConvertCSR2CSC().

◆ s_spmConvertCSR2CSC_gen()

static int s_spmConvertCSR2CSC_gen ( spmatrix_t spm)
static

convert a general matrix in CSR format to a matrix in CSC format.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

If the spm has multidof, we have to recompute the newal array It's done here because we need the new rowptr array

Definition at line 564 of file s_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::gN, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_NOTIMPLEMENTED, spm_get_value_idx_by_elt(), SPM_SUCCESS, SpmCSC, SpmCSR, spmExit(), and spmatrix_s::values.

Referenced by s_spmConvertCSR2CSC().

◆ z_spmConvertCSR2CSC_sym()

static int z_spmConvertCSR2CSC_sym ( spmatrix_t spm)
static

convert a symmetric matrix in CSR format to a matrix in CSC format.

Note that the transposed matrix is returned.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

Definition at line 413 of file z_spm_convert_to_csc.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::rowptr, SPM_SUCCESS, SpmCSC, and SpmCSR.

Referenced by z_spmConvertCSR2CSC().

◆ z_spmConvertCSR2CSC_gen()

static int z_spmConvertCSR2CSC_gen ( spmatrix_t spm)
static

convert a general matrix in CSR format to a matrix in CSC format.

Parameters
[in,out]spmThe csr matrix on entry, the csc matrix on exit.
Return values
SPM_SUCCESS,ifsucceeded
SPM_ERR_NOTIMPLEMENTED,itnot yet implemented

If the spm has multidof, we have to recompute the newal array It's done here because we need the new rowptr array

Definition at line 564 of file z_spm_convert_to_csc.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::gN, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_NOTIMPLEMENTED, spm_get_value_idx_by_elt(), SPM_SUCCESS, SpmCSC, SpmCSR, spmExit(), and spmatrix_s::values.

Referenced by z_spmConvertCSR2CSC().