mkl_dcsrbsr

Converts a sparse matrix in CSR format to BSR format.

Syntax

Fortran:

call mkl_dcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)

C:

mkl_dcsrbsr(job, &m, &mblk, &ldabsr, acsr, ja, ia, absr, jab, iab, &info);

Description

This routine is declared in mkl_spblas.fi for FORTRAN 77 interface and in mkl_spblas.h for C interface.

This routine converts a sparse matrix A stored in the compressed sparse row (CSR) format (3-array variation) to the block sparse row (BSR) format and vice versa.

Input Parameters

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.

job

INTEGER

Array, contains the following conversion parameters:

job(1)

If job(1)=0, the matrix in the CSR format is converted to the BSR format;

if job(1)=1, the matrix in the BSR format is converted to the CSR format.

job(2)

If job(2)=0, zero-based indexing for the matrix in CSR format is used;

if job(2)=1, one-based indexing for the matrix in CSR format is used.

job(3)

If job(3)=0, zero-based indexing for the matrix in the BSR format is used;

if job(3)=1, one-based indexing for the matrix in the BSR format is used.

job(6) - job indicator.

For conversion to the BSR format:

If job(6)=0, only arrays jab, iab are generated for the output storage.

If job(6)>0, all output arrays absr, jab, and iab are filled in for the output storage.

If job(6)=-1, iab(1) returns the number of non-zero blocks.

For conversion to the CSR format:

If job(6)=0, only arrays ja, ia are generated for the output storage.

m

INTEGER. Actual row dimension of the matrix A for convert to the BSR format; block row dimension of the matrix A for convert to the CSR format.

mblk

INTEGER. Size of the block in the matrix A.

ldabsr

INTEGER. Leading dimension of the array absr as declared in the calling program. ldabsr must be greater than or equal to mblk*mblk.

acsr

(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.

ja

(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.

ia

(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.

absr

(input/output) DOUBLE PRECISION.

Array containing elements of non-zero blocks of the matrix A. Its length is equal to the number of non-zero blocks in the matrix A multiplied by mblk*mblk. Refer to values array description in BSR Format for more details.

jab

(input/output) INTEGER. Array of length (m + 1), containing indices of block in the array absr, such that ja(i) is the index in the array absr of the first non-zero element from the i-th row . The value of the last element jab(m + 1) is equal to the number of non-zero blocks plus one. Refer to rowIndex array description in BSR Format for more details.

iab

(input/output) INTEGER. Array containing the column indices for each non-zero block of the matrix A.

Its length is equal to the number of non-zero blocks of the matrix A. Refer to columns array description in BSR Format for more details.

Output Parameters

info

INTEGER. Integer info indicator only for converting the matrix A from the CSR format.

If info=0, the execution is successful.

If info=1, it means that mblk is equal to 0.

If info=2, it means that ldabsr is less than mblk*mblk and there is no space for all blocks.

Interfaces

FORTRAN 77:

SUBROUTINE mkl_dcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info)
  INTEGER      job(8)
  INTEGER      m, mblk, ldabsr, info
  INTEGER      ja(*), ia(m+1), jab(*), iab(*)
  DOUBLE PRECISION       acsr(*), absr(ldabsr,*)

C:

void mkl_dcsrbsr(int *job, int *m, int *mblk, int *ldabsr, double *acsr, int *ja,
int *ia, double *absr, int *jab, int *iab, int *info);