aoclsparse_export_?csc() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
aoclsparse_status aoclsparse_export_scsc(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **col_ptr, aoclsparse_int **row_ind, float **val)#
aoclsparse_status aoclsparse_export_dcsc(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **col_ptr, aoclsparse_int **row_ind, double **val)#
aoclsparse_status aoclsparse_export_ccsc(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **col_ptr, aoclsparse_int **row_ind, aoclsparse_float_complex **val)#
aoclsparse_status aoclsparse_export_zcsc(const aoclsparse_matrix mat, aoclsparse_index_base *base, aoclsparse_int *m, aoclsparse_int *n, aoclsparse_int *nnz, aoclsparse_int **col_ptr, aoclsparse_int **row_ind, aoclsparse_double_complex **val)#

Export CSC matrix.

aoclsparse_export_?csc exposes the components defining the CSC 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 CSC format, an error is obtained.

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

  • base[out] aoclsparse_index_base_zero or aoclsparse_index_base_one.

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

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

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

  • col_ptr[out] array of n+1 elements that point to the start of every col of the sparse CSC matrix.

  • row_ind[out] array of nnz elements containing the row indices of the sparse CSC matrix.

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

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_pointermat or any of the output arguments are invalid.

  • aoclsparse_status_invalid_valuemat is not in CSC format.

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