clSPARSE  v0.10.0.0
a software library containing Sparse functions written in OpenCL
Functions
Matrix conversion routines

Sparse matrix routines to convert from one sparse format into another. More...

Functions

CLSPARSE_EXPORT clsparseStatus clsparseScsr2coo (const clsparseCsrMatrix *csr, clsparseCooMatrix *coo, const clsparseControl control)
 Convert a single precision CSR encoded sparse matrix into a COO encoded sparse matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2coo (const clsparseCsrMatrix *csr, clsparseCooMatrix *coo, const clsparseControl control)
 Convert a double precision CSR encoded sparse matrix into a COO encoded sparse matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseScoo2csr (const clsparseCooMatrix *coo, clsparseCsrMatrix *csr, const clsparseControl control)
 Convert a single precision COO encoded sparse matrix into a CSR encoded sparse matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseDcoo2csr (const clsparseCooMatrix *coo, clsparseCsrMatrix *csr, const clsparseControl control)
 Convert a double precision COO encoded sparse matrix into a CSR encoded sparse matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseScsr2dense (const clsparseCsrMatrix *csr, cldenseMatrix *A, const clsparseControl control)
 Convert a single precision CSR encoded sparse matrix into a dense matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2dense (const clsparseCsrMatrix *csr, cldenseMatrix *A, clsparseControl control)
 Convert a double precision CSR encoded sparse matrix into a dense matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseSdense2csr (const cldenseMatrix *A, clsparseCsrMatrix *csr, const clsparseControl control)
 Convert a single precision dense matrix into a CSR encoded sparse matrix. More...
 
CLSPARSE_EXPORT clsparseStatus clsparseDdense2csr (const cldenseMatrix *A, clsparseCsrMatrix *csr, const clsparseControl control)
 Convert a double precision dense matrix into a CSR encoded sparse matrix. More...
 

Detailed Description

Sparse matrix routines to convert from one sparse format into another.

Note
Input sparse matrices have to be sorted by row and then by column. The sparse conversion routines provided by clSPARSE require this as a pre-condition. The clsparse matrix file reading routines clsparse_C__MatrixfromFile guarantee this property as a post-condition.

Function Documentation

CLSPARSE_EXPORT clsparseStatus clsparseDcoo2csr ( const clsparseCooMatrix coo,
clsparseCsrMatrix csr,
const clsparseControl  control 
)

Convert a double precision COO encoded sparse matrix into a CSR encoded sparse matrix.

Parameters
[in]cooInput COO encoded sparse matrix
[out]csrOutput CSR encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2coo ( const clsparseCsrMatrix csr,
clsparseCooMatrix coo,
const clsparseControl  control 
)

Convert a double precision CSR encoded sparse matrix into a COO encoded sparse matrix.

Parameters
[in]csrInput CSR encoded sparse matrix
[out]cooOutput COO encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2dense ( const clsparseCsrMatrix csr,
cldenseMatrix A,
clsparseControl  control 
)

Convert a double precision CSR encoded sparse matrix into a dense matrix.

Parameters
[in]csrInput CSR encoded sparse matrix
[out]AOutput dense matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseDdense2csr ( const cldenseMatrix A,
clsparseCsrMatrix csr,
const clsparseControl  control 
)

Convert a double precision dense matrix into a CSR encoded sparse matrix.

Parameters
[in]AInput dense matrix
[out]csrOutput CSR encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseScoo2csr ( const clsparseCooMatrix coo,
clsparseCsrMatrix csr,
const clsparseControl  control 
)

Convert a single precision COO encoded sparse matrix into a CSR encoded sparse matrix.

Parameters
[in]cooInput COO encoded sparse matrix
[out]csrOutput CSR encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseScsr2coo ( const clsparseCsrMatrix csr,
clsparseCooMatrix coo,
const clsparseControl  control 
)

Convert a single precision CSR encoded sparse matrix into a COO encoded sparse matrix.

Parameters
[in]csrInput CSR encoded sparse matrix
[out]cooOutput COO encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseScsr2dense ( const clsparseCsrMatrix csr,
cldenseMatrix A,
const clsparseControl  control 
)

Convert a single precision CSR encoded sparse matrix into a dense matrix.

Parameters
[in]csrInput CSR encoded sparse matrix
[out]AOutput dense matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns
CLSPARSE_EXPORT clsparseStatus clsparseSdense2csr ( const cldenseMatrix A,
clsparseCsrMatrix csr,
const clsparseControl  control 
)

Convert a single precision dense matrix into a CSR encoded sparse matrix.

Parameters
[in]AInput dense matrix
[out]csrOutput CSR encoded sparse matrix
[in]controlA valid clsparseControl created with clsparseCreateControl
Precondition
The sparse matrix data must first be sorted by rows, then by columns