Developer Reference for Intel® oneAPI Math Kernel Library for C
Vector Arguments in BLAS
vector arguments Vector arguments vector arguments are passed in one-dimensional arrays. The vector arguments array dimension array dimension dimension ( length. dimension length) and vector vector arguments increment increment increment are passed as integer variables. The length determines the number of elements in the vector. The increment (also called stride stride. increment ) determines the spacing between vector elements and the order of the elements in the array in which the vector is passed.
x[0], x[|incx|], ..., x[(n-1)* |incx|]
idimx = 1 + (n-1)* |incx |
Example. One-dimensional Real Array
x = ([1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0)].
If incx =2 and n = 3 , then the vector argument with elements in order from first to last is ([1.0, 5.0, 9.0)] .
If incx = -2 and n = 4 , then the vector elements in order from first to last is ([13.0, 9.0, 5.0, 1.0)] .
If incx = 0 and n = 4 , then the vector elements in order from first to last is ([1.0, 1.0, 1.0, 1.0)] .
matrix one-dimensional substructures One-dimensional substructures of a matrix, such as the rows, columns, and diagonals, can be passed as vector arguments matrix one-dimensional substructures vector arguments with the starting address and increment specified.
Storage of the m-by-n matrix can be based on either matrix arguments column-major ordering column-major ordering where the increment between elements in the same column is 1 , the increment between elements in the same row is m , and the increment between elements on the same diagonal is m + 1 ; or row-major ordering where the increment between elements in the same row is 1 , the increment between elements in the same column is n , and the increment between elements on the same diagonal is n + 1 .
Example. Two-dimensional Real Matrix
Let a be a real 5 x 4 matrix declared as REAL A (5,4)float a[5*4]; .
cblas_sscal (5, 2.0, a[2], 4)
cblas_sscal (4, 2.0, a[4], 1)
cblas_sscal (4, 2.0, a[0], 5)