Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 6/24/2024
Public

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

Document Table of Contents

mkl_?dnscsr

Convert a sparse matrix in uncompressed representation to the CSR format and vice versa (deprecated).

Syntax

call mkl_sdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)

call mkl_ddnscsr(job, m, n, adns, lda, acsr, ja, ia, info)

call mkl_cdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)

call mkl_zdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)

Include Files

  • mkl.fi

Description

This routine is deprecated, but no replacement is available yet in the Inspector-Executor Sparse BLAS API interfaces. Either write your own or continue using this routine until a replacement is provided and this can be fully removed.

This routine converts a sparse matrix A between formats: stored as a rectangular array (dense representation) and stored using compressed sparse row (CSR) format (3-array variation).

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): Conversion type.

    • 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): index base for the rectangular matrix A.

    • 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): Index base for the matrix in CSR format.

    • 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): Portion of matrix.

    • 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)=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.

m

INTEGER. Number of rows of the matrix A.

n

INTEGER. Number of columns of the matrix A.

adns

(input/output)

REAL for mkl_sdnscsr.

DOUBLE PRECISION for mkl_ddnscsr.

COMPLEX for mkl_cdnscsr.

DOUBLE COMPLEX for mkl_zdnscsr.

If the conversion type is from uncompressed to CSR, on input adns contains an uncompressed (dense) representation of matrix A.

lda

INTEGER. Specifies the leading dimension of adns as declared in the calling (sub)program.

For zero-based indexing of A, lda must be at least max(1, n).

For one-based indexing of A, lda must be at least max(1, m).

acsr

(input/output)

REAL for mkl_sdnscsr.

DOUBLE PRECISION for mkl_ddnscsr.

COMPLEX for mkl_cdnscsr.

DOUBLE COMPLEX for mkl_zdnscsr.

If conversion type is from CSR to uncompressed, on input acsr contains the 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. If conversion type is from CSR to uncompressed, on input ja contains 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.

If conversion type is from CSR to uncompressed, on input ia contains 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 ofia(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.

Output Parameters

adns

If conversion type is from CSR to uncompressed, on output adns contains the uncompressed (dense) representation of matrix A.

acsr, ja, ia

If conversion type is from uncompressed to CSR, on output acsr, ja, and ia contain the compressed sparse row (CSR) format (3-array variation) of matrix A (see Sparse Matrix Storage Formats for a description of the storage format).

info

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 acsr and ja according to the value nzmax.

Interfaces

FORTRAN 77:

SUBROUTINE mkl_sdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
  INTEGER       job(8)
  INTEGER       m, n, lda, info
  INTEGER      ja(*), ia(m+1)
  REAL         adns(*), acsr(*)

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

SUBROUTINE mkl_cdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
  INTEGER       job(8)
  INTEGER       m, n, lda, info
  INTEGER      ja(*), ia(m+1)
  COMPLEX      adns(*), acsr(*)

SUBROUTINE mkl_zdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)
  INTEGER       job(8)
  INTEGER       m, n, lda, info
  INTEGER      ja(*), ia(m+1)
  DOUBLE COMPLEX      adns(*), acsr(*)