## Developer Reference

Contents

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

## Syntax

Include Files
• mkl.h
Description
This routine is deprecated. Use mkl_sparse_?_addfrom the
Intel® oneAPI Math Kernel Library
The
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
) =
B
T
, or
op(
B
) =
B
H
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.
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
+
beta
*
B
If
trans
=
'T'
or
't'
, then
C
:=
A
+
beta
*
B
T
If
trans
=
'C'
or
'c'
, then
C
:=
A
+
beta
*
B
H
.
request
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
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
sort
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
Number of rows of the matrix
A
.
n
Number of columns of the matrix
A
.
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
, containing indices of elements in the array
a
, such that
ia
[
i
] -
ia

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.
beta
Specifies the scalar
beta
.
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
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
] -
ib

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
]
or
ib
[
n
]
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
, containing indices of elements in the array
c
, such that
ic
[
i
] -
ic

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

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.