Developer Reference for Intel® oneAPI Math Kernel Library for C
mkl_sparse_?_create_coo
Creates a handle for a matrix in COO format.
Syntax
sparse_status_t mkl_sparse_s_create_coo ( sparse_matrix_t *p_A,
const sparse_index_base_t indexing,
const MKL_INT rows,
const MKL_INT cols,
const MKL_INT nnz,
MKL_INT *row_indx,
MKL_INT *col_indx,
float *values );
sparse_status_t mkl_sparse_d_create_coo ( sparse_matrix_t *p_A,
const sparse_index_base_t indexing,
const MKL_INT rows,
const MKL_INT cols,
const MKL_INT nnz,
MKL_INT *row_indx,
MKL_INT *col_indx,
double *values );
sparse_status_t mkl_sparse_c_create_coo ( sparse_matrix_t *p_A,
const sparse_index_base_t indexing,
const MKL_INT rows,
const MKL_INT cols,
const MKL_INT nnz,
MKL_INT *row_indx,
MKL_INT *col_indx,
MKL_Complex8 *values );
sparse_status_t mkl_sparse_z_create_coo ( sparse_matrix_t *p_A,
const sparse_index_base_t indexing,
const MKL_INT rows,
const MKL_INT cols,
const MKL_INT nnz,
MKL_INT *row_indx,
MKL_INT *col_indx,
MKL_Complex16 *values );
Include Files
mkl_spblas.h
Description
The mkl_sparse_?_create_coo routine creates a handle for an m -by- k matrix A in the Coordinate (COO) format and fills it with user provided data arrays.
Input Parameters
indexing
Indicates how input arrays are indexed:
SPARSE_INDEX_BASE_ZERO |
Zero-based (C-style) indexing: indices start at 0. |
SPARSE_INDEX_BASE_ONE |
One-based (Fortran-style) indexing: indices start at 1. |
rows
Number of rows of matrix A .
cols
Number of columns of matrix A .
nnz
Specifies the number of stored elements (sometimes called the non-zero elements, but they can be explicit zeros) of the matrix \(A\) . Refer to nnz description in Coordinate Format for more details.
row_indx
Array of length nnz, containing the row indices for each stored element of matrix \(A\) . Refer to rows array description in Coordinate Format for more details.
col_indx
Array of length nnz , containing the column indices for each non-zero element of matrix \(A\) . Refer to columns array description in Coordinate Format for more details.
values
Array of length nnz , containing the stored elements of matrix A. Refer to values array description in Coordinate Format for more details.
Output Parameters
- p_A
-
Pointer to handle containing internal data.
Return Values
The function returns a value indicating whether the operation was successful or not, and why.
SPARSE_STATUS_SUCCESS |
The operation was successful. |
SPARSE_STATUS_NOT_INITIALIZED |
The routine encountered an empty handle or matrix array. |
SPARSE_STATUS_ALLOC_FAILED |
Internal memory allocation failed. |
SPARSE_STATUS_INVALID_VALUE |
The input parameters contain an invalid value. |
SPARSE_STATUS_EXECUTION_FAILED |
Execution failed. |
SPARSE_STATUS_INTERNAL_ERROR |
An error in algorithm implementation occurred. |
SPARSE_STATUS_NOT_SUPPORTED |
The requested operation is not supported. |