Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_?csrbsr

Converts a square sparse matrix in the CSR format to the BSR format and vice versa (deprecated).

Syntax

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

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

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

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

Include Files

  • mkl.fi

Description

This routine is deprecated. Use the matrix manipulation routinesfrom the Intel® oneAPI Math Kernel Library (oneMKL) Inspector-executor Sparse BLAS interface instead.

This routine converts a square 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(4) is only used for conversion to CSR format. By default, the converter saves the blocks without checking whether an element is zero or not. If job(4)=1, then the converter only saves non-zero elements in blocks.

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)

REAL for mkl_scsrbsr.

DOUBLE PRECISION for mkl_dcsrbsr.

COMPLEX for mkl_ccsrbsr.

DOUBLE COMPLEX for mkl_zcsrbsr.

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 elementia(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)

REAL for mkl_scsrbsr.

DOUBLE PRECISION for mkl_dcsrbsr.

COMPLEX for mkl_ccsrbsr.

DOUBLE COMPLEX for mkl_zcsrbsr.

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

iab

(input/output)INTEGER. Array of length (m + 1), containing indices of blocks in the array absr, such that iab(i) is the index in the array absr of the first non-zero element from the i-th row . The value of the last elementiab(m + 1) is equal to the number of non-zero blocks plus one. Refer to rowIndex 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_scsrbsr(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(*)
  REAL         acsr(*), absr(ldabsr,*)

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,*)

SUBROUTINE mkl_ccsrbsr(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(*)
  COMPLEX       acsr(*), absr(ldabsr,*)

SUBROUTINE mkl_zcsrbsr(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 COMPLEX       acsr(*), absr(ldabsr,*)