Developer Reference for Intel® oneAPI Math Kernel Library for C

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

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

Syntax

void mkl_dcsrdia (const MKL_INT *job , const MKL_INT *n , double *acsr , MKL_INT *ja , MKL_INT *ia , double *adia , const MKL_INT *ndiag , MKL_INT *distance , MKL_INT *idiag , double *acsr_rem , MKL_INT *ja_rem , MKL_INT *ia_rem , MKL_INT *info );

void mkl_scsrdia (const MKL_INT *job , const MKL_INT *n , float *acsr , MKL_INT *ja , MKL_INT *ia , float *adia , const MKL_INT *ndiag , MKL_INT *distance , MKL_INT *idiag , float *acsr_rem , MKL_INT *ja_rem , MKL_INT *ia_rem , MKL_INT *info );

void mkl_ccsrdia (const MKL_INT *job , const MKL_INT *n , MKL_Complex8 *acsr , MKL_INT *ja , MKL_INT *ia , MKL_Complex8 *adia , const MKL_INT *ndiag , MKL_INT *distance , MKL_INT *idiag , MKL_Complex8 *acsr_rem , MKL_INT *ja_rem , MKL_INT *ia_rem , MKL_INT *info );

void mkl_zcsrdia (const MKL_INT *job , const MKL_INT *n , MKL_Complex16 *acsr , MKL_INT *ja , MKL_INT *ia , MKL_Complex16 *adia , const MKL_INT *ndiag , MKL_INT *distance , MKL_INT *idiag , MKL_Complex16 *acsr_rem , MKL_INT *ja_rem , MKL_INT *ia_rem , MKL_INT *info );

Include Files

  • mkl.h

Description

This routine is deprecated, but no replacement is available yet in the Inspector-Executor Sparse BLAS API interfaces. Either write your own (see the examples/c/sparse_blas/source/sparse_converters.c example for hints) or continue using this routine until a replacement is provided and this can be fully removed.

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

job

Array, contains the following conversion parameters:

job[0]

If job[0]=0, the matrix in the CSR format is converted to the diagonal format;

if job[0]=1, the matrix in the diagonal format is converted to the CSR format.

job[1]

If job[1]=0, zero-based indexing for the matrix in CSR format is used;

if job[1]=1, one-based indexing for the matrix in CSR format is used.

job[2]

If job[2]=0, zero-based indexing for the matrix in the diagonal format is used;

if job[2]=1, one-based indexing for the matrix in the diagonal format is used.

job[5] - job indicator.

For conversion to the diagonal format:

If job[5]=0, diagonals are not selected internally, and acsr_rem, ja_rem, ia_rem are not filled in for the output storage.

If job[5]=1, diagonals are not selected internally, and acsr_rem, ja_rem, ia_rem are filled in for the output storage.

If job[5]=10, diagonals are selected internally, and acsr_rem, ja_rem, ia_rem are not filled in for the output storage.

If job[5]=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[5]=0, each entry in the array adia is checked whether it is zero. Zero entries are not included in the array acsr.

If job[5]≠0, each entry in the array adia is not checked whether it is zero.

m

Dimension of the matrix A.

acsr

(input/output)

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). 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). Array of length m + 1, containing indices of elements in the array acsr, such that ia[i] - ia[0] is the index in the array acsr of the first non-zero element from the row i. The value of ia[m] - ia[0] is equal to the number of non-zeros. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.

adia

(input/output)

Array of size (ndiag*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

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

distance

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

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

This parameter is not used now.