hipsparsescsr2csr_compress Interface Reference#
Convert a sparse CSR matrix into a compressed sparse CSR matrix. More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2csr_compress_ (handle, m, n, descra, csrvala, csrcolinda, csrrowptra, nnza, nnzperrow, csrvalc, csrcolindc, csrrowptrc, tol) |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2csr_compress_rank_0 (handle, m, n, descra, csrvala, csrcolinda, csrrowptra, nnza, nnzperrow, csrvalc, csrcolindc, csrrowptrc, tol) |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2csr_compress_rank_1 (handle, m, n, descra, csrvala, csrcolinda, csrrowptra, nnza, nnzperrow, csrvalc, csrcolindc, csrrowptrc, tol) |
Detailed Description
Convert a sparse CSR matrix into a compressed sparse CSR matrix.
hipsparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol:
\[ C(i,j) = A(i, j) \text{ if |A(i, j)| > tol} \]
The user must first call hipsparseSnnz_compress "hipsparseXnnz_compress()" to determine the number of non-zeros per row as well as the total number of non-zeros that will exist in resulting compressed CSR matrix. The user then uses this information to allocate the column indices array csrColIndC and the values array csrValC. The user then calls hipsparseXcsr2csr_compress to complete the conversion.
- Note
- In the case of complex matrices, only the magnitude of the real part of
tolis used.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] m - number of rows of the sparse CSR matrix. [in] n - number of columns of the sparse CSR matrix. [in] descrA - matrix descriptor for the CSR matrix. [in] csrValA - array of nnzAelements of the sparse CSR matrix.[in] csrRowPtrA - array of m+1elements that point to the start of every row of the uncompressed sparse CSR matrix.[in] csrColIndA - array of nnzAelements containing the column indices of the uncompressed sparse CSR matrix.[in] nnzA - number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix. [in] nnzPerRow - array of length mcontaining the number of entries that will be kept per row in the final compressed CSR matrix.[out] csrValC - array of nnzCelements of the compressed sparse CSC matrix.[out] csrRowPtrC - array of m+1elements that point to the start of every column of the compressed sparse CSR matrix.[out] csrColIndC - array of nnzCelements containing the row indices of the compressed sparse CSR matrix.[in] tol - the non-negative tolerance used for compression. If tolis complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle,m,n,nnzA,tol,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC, ornnzPerRowpointer is invalid.
Member Function/Subroutine Documentation
◆ hipsparsescsr2csr_compress_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2csr_compress::hipsparsescsr2csr_compress_ | ( | type(c_ptr), value | handle, |
| integer(c_int), value | m, | ||
| integer(c_int), value | n, | ||
| type(c_ptr), value | descra, | ||
| type(c_ptr), value | csrvala, | ||
| type(c_ptr), value | csrcolinda, | ||
| type(c_ptr), value | csrrowptra, | ||
| integer(c_int), value | nnza, | ||
| type(c_ptr), value | nnzperrow, | ||
| type(c_ptr), value | csrvalc, | ||
| type(c_ptr), value | csrcolindc, | ||
| type(c_ptr), value | csrrowptrc, | ||
| real(c_float), value | tol | ||
| ) |
◆ hipsparsescsr2csr_compress_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2csr_compress::hipsparsescsr2csr_compress_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| type(c_ptr) | descra, | ||
| real(c_float), target | csrvala, | ||
| integer(c_int), target | csrcolinda, | ||
| integer(c_int), target | csrrowptra, | ||
| integer(c_int) | nnza, | ||
| integer(c_int), target | nnzperrow, | ||
| real(c_float), target | csrvalc, | ||
| integer(c_int), target | csrcolindc, | ||
| integer(c_int), target | csrrowptrc, | ||
| real(c_float) | tol | ||
| ) |
◆ hipsparsescsr2csr_compress_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2csr_compress::hipsparsescsr2csr_compress_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| type(c_ptr) | descra, | ||
| real(c_float), dimension(:), target | csrvala, | ||
| integer(c_int), dimension(:), target | csrcolinda, | ||
| integer(c_int), dimension(:), target | csrrowptra, | ||
| integer(c_int) | nnza, | ||
| integer(c_int), dimension(:), target | nnzperrow, | ||
| real(c_float), dimension(:), target | csrvalc, | ||
| integer(c_int), dimension(:), target | csrcolindc, | ||
| integer(c_int), dimension(:), target | csrrowptrc, | ||
| real(c_float) | tol | ||
| ) |
The documentation for this interface was generated from the following file: