Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/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_?csradd

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

Syntax

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

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

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

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

Include Files

  • mkl.fi

Description

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

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

C := A+beta*op(B)

where:

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

op(B) is one of op(B) = B, or op(B) = BT, or op(B) = BH

beta is a scalar.

The routine works correctly if and only if the column indices in sparse matrix representations of matrices A and B are arranged in the increasing order for each row. If not, use the parameter sort (see below) to reorder column indices and the corresponding elements of the input matrices.

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+beta*B

If trans = 'T' or 't', then C := A+beta*BT

If trans = 'C' or 'c', then C := A+beta*BH.

request

INTEGER.

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

If request=1, the routine only computes the values of the array ic of length m + 1. The memory for the ic 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, after the routine is called previously with the parameter request=1 and after the output arrays jc and c are allocated in the calling program with length at least ic(m+1) - 1, the routine performs addition.

sort

INTEGER. Specifies the type of reordering. If this parameter is not set (default), the routine does not perform reordering.

If sort=1, the routine arranges the column indices ja for each row in the increasing order and reorders the corresponding values of the matrix A in the array a.

If sort=2, the routine arranges the column indices jb for each row in the increasing order and reorders the corresponding values of the matrix B in the array b.

If sort=3, the routine performs reordering for both input matrices A and B.

m

INTEGER. Number of rows of the matrix A.

n

INTEGER. Number of columns of the matrix A.

a

REAL for mkl_scsradd.

DOUBLE PRECISION for mkl_dcsradd.

COMPLEX for mkl_ccsradd.

DOUBLE COMPLEX for mkl_zcsradd.

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, containing 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.

beta

REAL for mkl_scsradd.

DOUBLE PRECISION for mkl_dcsradd.

COMPLEX for mkl_ccsradd.

DOUBLE COMPLEX for mkl_zcsradd.

Specifies the scalar beta.

b

REAL for mkl_scsradd.

DOUBLE PRECISION for mkl_dcsradd.

COMPLEX for mkl_ccsradd.

DOUBLE COMPLEX for mkl_zcsradd.

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 m + 1 when trans = 'N' or 'n', or n + 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(m + 1) or ib(n + 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_scsradd.

DOUBLE PRECISION for mkl_dcsradd.

COMPLEX for mkl_ccsradd.

DOUBLE COMPLEX for mkl_zcsradd.

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, containing 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) 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_scsradd( trans, request, sort, m, n, a, ja, ia, beta, b, jb, ib, c, jc, ic, nzmax, info)
   CHARACTER  trans
   INTEGER       request, sort, m, n, nzmax, info
   INTEGER       ja(*), jb(*), jc(*), ia(*), ib(*), ic(*)
   REAL            a(*), b(*), c(*), beta

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

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

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