XLPack 7.0
Python API Reference Manual
Loading...
Searching...
No Matches

◆ csr_ssr()

def csr_ssr ( uplo  ,
,
val  ,
rowptr  ,
colind  ,
base  ,
val2  ,
rowptr2  ,
colind2  ,
base2   
)

CSR (symmetric full matrix) -> SSR (CSR sparse matrix packed form)

Purpose
This routine converts the general CSR sparse matrix containing all elements to the symmetric CSR sparse matrix containing only upper or lower triangular elements.

In current version, the triangular elements (not including diagonal elements) other than specified by uplo in input matrix will be simply ignored, and it is not tested if it is symmetric matrix.
Returns
info (int)
= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= j > 0: j elements in input matrix were ignored.
Parameters
[in]uploSpecifies whether the upper or lower triangular part is stored in the output matrix.
= 'U': Upper triangular part.
= 'L': Lower triangular part.
[in]nNumber of rows and columns of matrix. (n >= 0) (if n = 0, returns without computation)
[in]valNumpy ndarray (1-dimensional, float, nnz)
Values of nonzero elements of input matrix (nnz is the number of nonzero elements of input matrix).
[in]rowptrNumpy ndarray (1-dimensional, int32, n + 1)
Row pointers of input matrix.
[in]colindNumpy ndarray (1-dimensional, int32, nnz)
Column indices of input matrix (nnz is the number of nonzero elements of input matrix).
[in]baseIndexing of rowptr and colind.
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[out]val2Numpy ndarray (1-dimensional, float, nnz2)
Values of nonzero elements of output matrix (nnz2, the size of arrays val2 and colind2, must be greater than the number of nonzero elements of the upper or lower triangular part of the input matrix).
[out]rowptr2Numpy ndarray (1-dimensional, int32, n + 1)
Row pointers of output matrix.
[out]colind2Numpy ndarray (1-dimensional, int32, nnz2)
Column indices of output matrix (nnz2, the size of arrays val2 and colind2, must be greater than the number of nonzero elements of the upper or lower triangular part of the input matrix).
[in]base2Indexing of rowptr2 and colind2.
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.