aoclsparse_export_?coo() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
aoclsparse_status aoclsparse_export_scoo(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **row_ptr, aoclsparse_int **col_ptr, float **val)#
aoclsparse_status aoclsparse_export_dcoo(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **row_ptr, aoclsparse_int **col_ptr, double **val)#
aoclsparse_status aoclsparse_export_ccoo(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **row_ptr, aoclsparse_int **col_ptr, aoclsparse_float_complex **val)#
aoclsparse_status aoclsparse_export_zcoo(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **row_ptr, aoclsparse_int **col_ptr, aoclsparse_double_complex **val)#

Export a COO matrix.

aoclsparse_export_?coo exposes the components defining the COO matrix in mat structure by copying out the data pointers. No additional memory is allocated. User should not modify the arrays and once aoclsparse_destroy() is called to free mat, these arrays will become inaccessible. If the matrix is not in COO format, an error is obtained.

Parameters:
  • mat[in] the pointer to the COO sparse matrix.

  • base[out] aoclsparse_index_base_zero or aoclsparse_index_base_one.

  • m[out] number of rows of the sparse COO matrix.

  • n[out] number of columns of the sparse COO matrix.

  • nnz[out] number of non-zero entries of the sparse CSR matrix.

  • row_ptr[out] array of nnz elements containing the row indices of the sparse COO matrix.

  • col_ptr[out] array of nnz elements containing the column indices of the sparse COO matrix.

  • val[out] array of nnz elements of the sparse COO matrix.

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_pointermat or any of the output arguments are NULL.

  • aoclsparse_status_invalid_valuemat is not in COO format.

  • aoclsparse_status_wrong_type – data type of mat does not match the function.