Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 11/07/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_?csrmultcsr

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

Syntax

call mkl_scsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)

call mkl_dcsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)

call mkl_ccsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)

call mkl_zcsrmultcsr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)

Include Files

  • mkl.fi

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

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.

trans

CHARACTER*1. 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

INTEGER.

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) - 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) - 1 at least.

sort

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

m

INTEGER. Number of rows of the matrix A.

n

INTEGER. Number of columns of the matrix A.

k

INTEGER. Number of columns of the matrix B.

a

REAL for mkl_scsrmultcsr.

DOUBLE PRECISION for mkl_dcsrmultcsr.

COMPLEX for mkl_ccsrmultcsr.

DOUBLE COMPLEX for mkl_zcsrmultcsr.

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

INTEGER. Array containing the column indices 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

INTEGER. Array of length m + 1.

This array contains indices of elements in the array a, such that ia(i) 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 + 1) 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

REAL for mkl_scsrmultcsr.

DOUBLE PRECISION for mkl_dcsrmultcsr.

COMPLEX for mkl_ccsrmultcsr.

DOUBLE COMPLEX for mkl_zcsrmultcsr.

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

INTEGER. Array containing the column indices 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

INTEGER. 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) 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 + 1) or ib(m + 1) 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

INTEGER. 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

REAL for mkl_scsrmultcsr.

DOUBLE PRECISION for mkl_dcsrmultcsr.

COMPLEX for mkl_ccsrmultcsr.

DOUBLE COMPLEX for mkl_zcsrmultcsr.

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

INTEGER. Array containing the column indices 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

INTEGER. 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) 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 + 1) or ic(n + 1) 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

INTEGER.

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.

Interfaces

FORTRAN 77:

SUBROUTINE mkl_scsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)
   CHARACTER*1  trans
   INTEGER       request, sort, m, n, k, nzmax, info
   INTEGER       ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
   REAL            a(*), b(*), c(*)

SUBROUTINE mkl_dcsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)
   CHARACTER*1  trans
   INTEGER       request, sort, m, n, k, nzmax, info
   INTEGER       ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
   DOUBLE PRECISION            a(*), b(*), c(*)

SUBROUTINE mkl_ccsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)
   CHARACTER*1  trans
   INTEGER       request, sort, m, n, k, nzmax, info
   INTEGER       ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
   COMPLEX     a(*), b(*), c(*)

SUBROUTINE mkl_zcsrmultcsr( trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)
   CHARACTER*1  trans
   INTEGER       request, sort, m, n, k, nzmax, info
   INTEGER       ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
   DOUBLE COMPLEX       a(*), b(*), c(*)