Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_graph_matrix_get_csr

Exports a CSR representation of a graph matrix.

Syntax

mkl_graph_status_t mkl_graph_matrix_get_csr (mkl_graph_matrix_t A, int64_t *nrows, int64_t *ncols, void **rows_start, mkl_graph_type_t *rows_start_type, void **col_indx, mkl_graph_type_t *col_indx_type, void **values, mkl_graph_type_t *values_type);

Include Files
  • mkl_graph.h

Description

The mkl_graph_matrix_get_csr routine exports the CSR representation of a graph matrix in the 3-array variation. All output arguments are optional and will not be used if NULL pointers are passed. For each array in the 3-array CSR format (rows_start, col_indx or values) the type of the elements can be obtained from a corresponding parameter of type mkl_graph_type_t.

Refer to Sparse Matrix Storage Formats for further details on the CSR format.

NOTE:

The routine mkl_graph_matrix_get_csr does not change the ownership of the data. In particular, you should not directly deallocate the returned pointers. A call to mkl_graph_matrix_destroy handles freeing any data allocated by Intel® oneAPI Math Kernel Library.

NOTE:

If only information about the number of rows or the number of columns is needed, mkl_graph_matrix_get_property can be used instead of mkl_graph_matrix_get_csr.

Input Parameters
A

A graph matrix from which data are retrieved.

Output Parameters
nrows

Number of rows in the matrix. Ignored if NULL is passed.

ncols

Number of columns in the matrix. Ignored if NULL is passed.

rows_start

A pointer to an array of length at least (n+1), where n is the number of rows in the matrix. The array contains row indices, such that rows_start[i] is the index of the first non-zero entry in row i in the arrays col_indx and values. The value rows_start[n]- rows_start[0] will be the total number of nonzero entries in the matrix. Type of the array elements can be deduced from rows_start_type.

Ignored if NULL.

Refer to pointerB array description in CSR Format for more details.

rows_start_type

Type of the elements of the rows_start array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

col_indx

A pointer to an array which contains zero-based column indices for the non-zero entries of the matrix A. Type of the array elements can be deduced from col_indx_type. Ignored if NULL.

Refer to the columns array description in CSR Format for more details.

col_indx_type

Type of the elements of the col_indx array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

values

A pointer to an array which contains values for the nonzero entries of the matrix A. The type of the array elements can be deduced from values_type.

Ignored if NULL.

Refer to the values array description in CSR Format for more details.

values_type

Type of the elements of the values array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

Return Values

The function returns a value indicating whether the operation was successful or not and why. Refer to Graph API Glossary for a list of possible options.

Product and Performance Information

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

Notice revision #20201201