Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/22/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_?csrcoo

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

Syntax

call mkl_scsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)

call mkl_dcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)

call mkl_ccsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)

call mkl_zcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, 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 coordinate 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 coordinate format;

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

if job(1)=2, the matrix in the coordinate format is converted to the CSR format, and the column indices in CSR representation are sorted in the increasing order within each row.

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 coordinate format is used;

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

job(5)

job(5)=nzmax - maximum number of the non-zero elements allowed if job(1)=0.

job(6) - job indicator.

For conversion to the coordinate format:

If job(6)=1, only array rowind is filled in for the output storage.

If job(6)=2, arrays rowind, colind are filled in for the output storage.

If job(6)=3, all arrays rowind, colind, acoo are filled in for the output storage.

For conversion to the CSR format:

If job(6)=0, all arrays acsr, ja, ia are filled in for the output storage.

If job(6)=1, only array ia is filled in for the output storage.

If job(6)=2, then it is assumed that the routine already has been called with the job(6)=1, and the user allocated the required space for storing the output arrays acsr and ja.

n

INTEGER. Dimension of the matrix A.

nnz

INTEGER. Specifies the number of non-zero elements of the matrix A for job(1)0.

Refer to nnz description in Coordinate Format for more details.

acsr

(input/output)

REAL for mkl_scsrcoo.

DOUBLE PRECISION for mkl_dcsrcoo.

COMPLEX for mkl_ccsrcoo.

DOUBLE COMPLEX for mkl_zcsrcoo.

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 n + 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(n + 1) is equal to the number of non-zeros plus one. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.

acoo

(input/output)

REAL for mkl_scsrcoo.

DOUBLE PRECISION for mkl_dcsrcoo.

COMPLEX for mkl_ccsrcoo.

DOUBLE COMPLEX for mkl_zcsrcoo.

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.

rowind

(input/output)INTEGER. Array of length nnz, contains the row indices for each non-zero element of the matrix A.

Refer to rows array description in Coordinate Format for more details.

colind

(input/output)INTEGER. Array of length nnz, contains the column indices for each non-zero element of the matrix A. Refer to columns array description in Coordinate Format for more details.

Output Parameters

nnz

Returns the number of converted elements of the matrix A for job(1)=0.

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, the routine is interrupted because there is no space in the arrays acoo, rowind, colind according to the value nzmax.

Interfaces

FORTRAN 77:

SUBROUTINE mkl_scsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
  INTEGER      job(8)
  INTEGER      n, nnz, info
  INTEGER      ja(*), ia(n+1), rowind(*), colind(*)
  REAL         acsr(*), acoo(*)

SUBROUTINE mkl_dcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
  INTEGER      job(8)
  INTEGER      n, nnz, info
  INTEGER      ja(*), ia(n+1), rowind(*), colind(*)
  DOUBLE PRECISION       acsr(*), acoo(*)

SUBROUTINE mkl_ccsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
  INTEGER      job(8)
  INTEGER      n, nnz, info
  INTEGER      ja(*), ia(n+1), rowind(*), colind(*)
  COMPLEX      acsr(*), acoo(*)

SUBROUTINE mkl_zcsrcoo(job, n, acsr, ja, ia, nnz, acoo, rowind, colind, info)
  INTEGER      job(8)
  INTEGER      n, nnz, info
  INTEGER      ja(*), ia(n+1), rowind(*), colind(*)
  DOUBLE COMPLEX      acsr(*), acoo(*)