Convert a sparse matrix to the CSR format and vice versa.
Fortran:
call mkl_ddnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
C:
mkl_ddnscsr(job, &m, &n, adns, &lda, acsr, ja, ia, &info);
This routine is declared in mkl_spblas.fi for FORTRAN 77 interface and in mkl_spblas.h for C interface.
This routine converts an sparse matrix stored as a rectangular m-by-n matrix A to the compressed sparse row (CSR) format (3-array variation) and vice versa.
Parameter descriptions are common for all implemented interfaces with the exception of data types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the section “Interfaces” below.
INTEGER
Array, contains the following conversion parameters:
job(1)
If job(1)=0, the rectangular matrix A is converted to the CSR format;
if job(1)=1, the rectangular matrix A is restored from the CSR format.
job(2)
If job(2)=0, zero-based indexing for the rectangular matrix A is used;
if job(2)=1, one-based indexing for the rectangular matrix A is used.
job(3)
If job(3)=0, zero-based indexing for the matrix in CSR format is used;
if job(3)=1, one-based indexing for the matrix in CSR format is used.
job(4)
If job(4)=0, adns is a lower triangular part of matrix A;
If job(4)=1, adns is an upper triangular part of matrix A;
If job(4)=2, adns is a whole matrix A.
job(5)
job(5)=nzmax - maximum number of the non-zero elements allowed if job(1)=0.
job(6) - job indicator for conversion to CSR format.
If job(6)=0, only array ia is generated for the output storage.
If job(6)>0, arrays acsr, ia, ja are generated for the output storage.
INTEGER. Number of rows of the matrix A.
INTEGER. Number of columns of the matrix A.
(input/output)DOUBLE PRECISION.
Array containing non-zero elements of the matrix A.
(input/output)INTEGER. Specifies the first dimension of adns as declared in the calling (sub)program, must be at least max(1, m).
(input/output)DOUBLE PRECISION.
Array containing non-zero elements of the matrix A. Its length is equal to the number of non-zero elements in the matrix A. Refer to values array description in Sparse Matrix Storage Formats for more details.
(input/output)INTEGER. Array containing the column indices for each non-zero element of the matrix A.
Its length is equal to the length of the array acsr. Refer to columns array description in Sparse Matrix Storage Formats for more details.
(input/output)INTEGER. Array of length m + 1, containing indices of elements in the array acsr, such that ia(I) is the index in the array acsr of the first non-zero element from the row I. The value of the last element ia(m + 1) is equal to the number of non-zeros plus one. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.
INTEGER. Integer info indicator only for restoring the matrix A from the CSR format.
If info=0, the execution is successful.
If info=i, the routine is interrupted processing the i-th row because there is no space in the arrays adns and ja according to the value nzmax.
SUBROUTINE mkl_ddnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
INTEGER job(8)
INTEGER m, n, lda, info
INTEGER ja(*), ia(m+1)
DOUBLE PRECISION adns(*), acsr(*)
void mkl_ddnscsr(int *job, int *m, int *n, double *adns,
int *lda, double *acsr, double ja, int *ia, int *info);