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_?csrdia

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

Syntax

call mkl_scsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)

call mkl_dcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)

call mkl_ccsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)

call mkl_zcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, 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 sparse matrix A stored in the compressed sparse row (CSR) format (3-array variation) to the diagonal 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 diagonal format;

if job(1)=1, the matrix in the diagonal 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 diagonal format is used;

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

job(6) - job indicator.

For conversion to the diagonal format:

If job(6)=0, diagonals are not selected internally, and acsr_rem, ja_rem, ia_rem are not filled in for the output storage.

If job(6)=1, diagonals are not selected internally, and acsr_rem, ja_rem, ia_rem are filled in for the output storage.

If job(6)=10, diagonals are selected internally, and acsr_rem, ja_rem, ia_rem are not filled in for the output storage.

If job(6)=11, diagonals are selected internally, and csr_rem, ja_rem, ia_rem are filled in for the output storage.

For conversion to the CSR format:

If job(6)=0, each entry in the array adia is checked whether it is zero. Zero entries are not included in the array acsr.

If job(6)≠0, each entry in the array adia is not checked whether it is zero.

m

INTEGER. Dimension of the matrix A.

acsr

(input/output)

REAL for mkl_scsrdia.

DOUBLE PRECISION for mkl_dcsrdia.

COMPLEX for mkl_ccsrdia.

DOUBLE COMPLEX for mkl_zcsrdia.

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.

adia

(input/output)

REAL for mkl_scsrdia.

DOUBLE PRECISION for mkl_dcsrdia.

COMPLEX for mkl_ccsrdia.

DOUBLE COMPLEX for mkl_zcsrdia.

Array of size (ndiag x idiag) containing diagonals of the matrix A.

The key point of the storage is that each element in the array adia retains the row number of the original matrix. To achieve this diagonals in the lower triangular part of the matrix are padded from the top, and those in the upper triangular part are padded from the bottom.

ndiag

INTEGER.

Specifies the leading dimension of the array adia as declared in the calling (sub)program, must be at least max(1, m).

distance

INTEGER.

Array of length idiag, containing the distances between the main diagonal and each non-zero diagonal to be extracted. The distance is positive if the diagonal is above the main diagonal, and negative if the diagonal is below the main diagonal. The main diagonal has a distance equal to zero.

idiag

INTEGER.

Number of diagonals to be extracted. For conversion to diagonal format on return this parameter may be modified.

acsr_rem, ja_rem, ia_rem

Remainder of the matrix in the CSR format if it is needed for conversion to the diagonal format.

Output Parameters

info

INTEGER. This parameter is not used now.

Interfaces

FORTRAN 77:

SUBROUTINE mkl_scsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)
  INTEGER      job(8)
  INTEGER      m, info, ndiag, idiag
  INTEGER      ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
  REAL         acsr(*), adia(*), acsr_rem(*)

SUBROUTINE mkl_dcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)
  INTEGER      job(8)
  INTEGER      m, info, ndiag, idiag
  INTEGER      ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
  DOUBLE PRECISION       acsr(*), adia(*), acsr_rem(*)

SUBROUTINE mkl_ccsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)
  INTEGER      job(8)
  INTEGER      m, info, ndiag, idiag
  INTEGER      ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
  COMPLEX      acsr(*), adia(*), acsr_rem(*)

SUBROUTINE mkl_zcsrdia(job, m, acsr, ja, ia, adia, ndiag, distance, idiag, acsr_rem, ja_rem, ia_rem, info)
  INTEGER      job(8)
  INTEGER      m, info, ndiag, idiag
  INTEGER      ja(*), ia(m+1), distance(*), ja_rem(*), ia_rem(*)
  DOUBLE COMPLEX       acsr(*), adia(*), acsr_rem(*)