Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

Interface Consideration

One-Based and Zero-Based Indexing

The
Intel® MKL
Sparse BLAS Level 2 and Level 3 routines support one-based and zero-based indexing of data arrays.
Routines with typical interfaces support zero-based indexing for the following sparse data storage formats: CSR, CSC, BSR, and COO. Routines with simplified interfaces support zero based indexing for the following sparse data storage formats: CSR, BSR, and COO. See the complete list of Sparse BLAS Level 2 and Level 3 Routines .
The one-based indexing uses the convention of starting array indices at 1. The zero-based indexing uses the convention of starting array indices at 0. For example, indices of the 5-element array
x
can be presented in case of one-based indexing as follows:
Element index:
1 2 3 4 5
Element value:
1.0 5.0 7.0 8.0 9.0
and in case of zero-based indexing as follows:
Element index:
0 1 2 3 4
Element value:
1.0 5.0 7.0 8.0 9.0
The detailed descriptions of the one-based and zero-based variants of the sparse data storage formats are given in the "Sparse Matrix Storage Formats" in
the
Appendix
"Linear Solvers Basics"
.
Most parameters of the routines are identical for both one-based and zero-based indexing, but some of them have certain differences. The following table lists all these differences.
Parameter
One-based Indexing
Zero-based Indexing
val
Array containing non-zero elements of the matrix
A
, its length is
pntre
(m) -
pntrb
(1)
.
Array containing non-zero elements of the matrix
A
, its length is
pntre
(m—1) -
pntrb
(0)
.
pntrb
Array of length
m
. This array contains row indices, such that
pntrb
(
i
) -
pntrb
(1)+1
is the first index of row
i
in the arrays
val
and
indx
Array of length
m
. This array contains row indices, such that
pntrb
(
i
) -
pntrb
(0)
is the first index of row
i
in the arrays
val
and
indx
.
pntre
Array of length
m
. This array contains row indices, such that
pntre
(
I
) -
pntrb
(1)
is the last index of row
i
in the arrays
val
and
indx
.
Array of length
m
. This array contains row indices, such that
pntre
(
i
) -
pntrb
(0)-1
is the last index of row
i
in the arrays
val
and
indx
.
ia
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-zeros plus one.
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
)
is equal to the number of non-zeros.
ldb
Specifies the leading dimension of
b
as declared in the calling (sub)program.
Specifies the second dimension of
b
as declared in the calling (sub)program.
ldc
Specifies the leading dimension of
c
as declared in the calling (sub)program.
Specifies the second dimension of
c
as declared in the calling (sub)program.

Differences Between Intel MKL and NIST* Interfaces

The
Intel® MKL
Sparse BLAS Level 3 routines have the following conventional interfaces:
mkl_xyyymm(