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

Computes product of two sparse matrices stored in the CSR format (3-array variation) with one-based indexing (deprecated).

Syntax

void mkl_dcsrmultcsr (const char *trans , const MKL_INT *request , const MKL_INT *sort , const MKL_INT *m , const MKL_INT *n , const MKL_INT *k , double *a , MKL_INT *ja , MKL_INT *ia , double *b , MKL_INT *jb , MKL_INT *ib , double *c , MKL_INT *jc , MKL_INT *ic , const MKL_INT *nzmax , MKL_INT *info );

void mkl_scsrmultcsr (const char *trans , const MKL_INT *request , const MKL_INT *sort , const MKL_INT *m , const MKL_INT *n , const MKL_INT *k , float *a , MKL_INT *ja , MKL_INT *ia , float *b , MKL_INT *jb , MKL_INT *ib , float *c , MKL_INT *jc , MKL_INT *ic , const MKL_INT *nzmax , MKL_INT *info );

void mkl_ccsrmultcsr (const char *trans , const MKL_INT *request , const MKL_INT *sort , const MKL_INT *m , const MKL_INT *n , const MKL_INT *k , MKL_Complex8 *a , MKL_INT *ja , MKL_INT *ia , MKL_Complex8 *b , MKL_INT *jb , MKL_INT *ib , MKL_Complex8 *c , MKL_INT *jc , MKL_INT *ic , const MKL_INT *nzmax , MKL_INT *info );

void mkl_zcsrmultcsr (const char *trans , const MKL_INT *request , const MKL_INT *sort , const MKL_INT *m , const MKL_INT *n , const MKL_INT *k , MKL_Complex16 *a , MKL_INT *ja , MKL_INT *ia , MKL_Complex16 *b , MKL_INT *jb , MKL_INT *ib , MKL_Complex16 *c , MKL_INT *jc , MKL_INT *ic , const MKL_INT *nzmax , MKL_INT *info );

Include Files

  • mkl.h

Description

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

The mkl_?csrmultcsr routine performs a matrix-matrix operation defined as

C := op(A)*B

where:

A, B, C are the sparse matrices in the CSR format (3-array variation);

op(A) is one of op(A) = A, or op(A) =AT, or op(A) = AH .

You can use the parameter sort to perform or not perform reordering of non-zero entries in input and output sparse matrices. The purpose of reordering is to rearrange non-zero entries in compressed sparse row matrix so that column indices in compressed sparse representation are sorted in the increasing order for each row.

The following table shows correspondence between the value of the parameter sort and the type of reordering performed by this routine for each sparse matrix involved:

Value of the parameter sort Reordering of A (arrays a, ja, ia) Reordering of B (arrays b, ja, ib) Reordering of C (arrays c, jc, ic)
1 yes no yes
2 no yes yes
3 yes yes yes
4 yes no no
5 no yes no
6 yes yes no
7 no no no
arbitrary value not equal to 1, 2,..., 7 no no yes

NOTE:

This routine supports only one-based indexing of the input arrays.

Input Parameters

trans

Specifies the operation.

If trans = 'N' or 'n', then C := A*B

If trans = 'T' or 't' or 'C' or 'c', then C := AT*B.

request

If request=0, the routine performs multiplication, the memory for the output arrays ic, jc, c must be allocated beforehand.

If request=1, the routine computes only values of the array ic of length m + 1, the memory for this array must be allocated beforehand. On exit the value ic[m] - 1 is the actual number of the elements in the arrays c and jc.

If request=2, the routine has been called previously with the parameter request=1, the output arrays jc and c are allocated in the calling program and they are of the length ic[m] - 1 at least.

sort

Specifies whether the routine performs reordering of non-zeros entries in input and/or output sparse matrices (see table above).

m

Number of rows of the matrix A.

n

Number of columns of the matrix A.

k

Number of columns of the matrix B.

a

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

Array containing the column indices plus one for each non-zero element of the matrix A. For each row the column indices must be arranged in the increasing order.

The length of this array is equal to the length of the array a. Refer to columns array description in Sparse Matrix Storage Formats for more details.

ia

Array of length m + 1.

This array contains indices of elements in the array a, such that ia[i] - ia[0] is the index in the array a of the first non-zero element from the row i. The value of the last element ia[m] is equal to the number of non-zero elements of the matrix A plus one. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.

b

Array containing non-zero elements of the matrix B. Its length is equal to the number of non-zero elements in the matrix B. Refer to values array description in Sparse Matrix Storage Formats for more details.

jb

Array containing the column indices plus one for each non-zero element of the matrix B. For each row the column indices must be arranged in the increasing order.

The length of this array is equal to the length of the array b. Refer to columns array description in Sparse Matrix Storage Formats for more details.

ib

Array of length n + 1 when trans = 'N' or 'n', or m + 1 otherwise.

This array contains indices of elements in the array b, such that ib[i] - ib[0] is the index in the array b of the first non-zero element from the row i. The value of the last element ib[n] or ib[m] is equal to the number of non-zero elements of the matrix B plus one. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.

nzmax

The length of the arrays c and jc.

This parameter is used only if request=0. The routine stops calculation if the number of elements in the result matrix C exceeds the specified value of nzmax.

Output Parameters

c

Array containing non-zero elements of the result matrix C. Its length is equal to the number of non-zero elements in the matrix C. Refer to values array description in Sparse Matrix Storage Formats for more details.

jc

Array containing the column indices plus one for each non-zero element of the matrix C.

The length of this array is equal to the length of the array c. Refer to columns array description in Sparse Matrix Storage Formats for more details.

ic

Array of length m + 1 when trans = 'N' or 'n', or n + 1 otherwise.

This array contains indices of elements in the array c, such that ic[i] - ic[0] is the index in the array c of the first non-zero element from the row i. The value of the last element ic[m] or ic[n] is equal to the number of non-zero elements of the matrix C plus one. Refer to rowIndex array description in Sparse Matrix Storage Formats for more details.

info

If info=0, the execution is successful.

If info=I>0, the routine stops calculation in the I-th row of the matrix C because number of elements in C exceeds nzmax.

If info=-1, the routine calculates only the size of the arrays c and jc and returns this value plus 1 as the last element of the array ic.