rocsolver_scsrrf_analysis Interface Reference

rocsolver_scsrrf_analysis Interface Reference#

HIPFORT API Reference: hipfort_rocsolver::rocsolver_scsrrf_analysis Interface Reference
hipfort_rocsolver::rocsolver_scsrrf_analysis Interface Reference

The CSRRF_ANALYSIS functions perform the analysis phase required by the refactorization functions CSRRF_REFACTLU and CSRRF_REFACTCHOL and by the direct solver CSRRF_SOLVE. More...

Public Member Functions

integer(kind(rocblas_status_success)) function rocsolver_scsrrf_analysis_ (handle, n, nrhs, nnzm, ptrm, indm, valm, nnzt, ptrt, indt, valt, pivp, pivq, b, ldb, rfinfo)
 

Detailed Description

The CSRRF_ANALYSIS functions perform the analysis phase required by the refactorization functions CSRRF_REFACTLU and CSRRF_REFACTCHOL and by the direct solver CSRRF_SOLVE.

Consider a sparse matrix \(M\) previously factorized as

\[ Q^TMQ = L_ML_M^T \]

(Cholesky factorization for the symmetric positive definite case), or

\[ PMQ = L_MU_M \]

(LU factorization for the general case)

where \(L_M\) is lower triangular (with unit diagonal in the general case), \(U_M\) is upper triangular, and \(P\) and \(Q\) are permutation matrices associated with pivoting and reordering (to minimize fill-in), respectively. The metadata generated by this routine is collected in the output parameter rfinfo. This information will allow the fast refactorization of another sparse matrix \(A\) as

\[ Q^TAQ = L_AL_A^T, \quad \text{or} \]

\[ PAQ = L_AU_A, \]

and, eventually, the computation of the solution vector \(X\) of any linear system of the form

\[ AX = B \]

as long as \(A\) has the same sparsity pattern as the previous matrix \(M\).

This function supposes that the rfinfo struct has been initialized by RFINFO_CREATE. By default, rfinfo is set up to work with the LU factorization (general matrices). If the matrix is symmetric positive definite, and the Cholesky factorization is desired, then the corresponding mode must be manually set up by SET_RFINFO_MODE. This function does not automatically detect symmetry.

For the LU factorization mode, the LU factors \(L_M\) and \(U_M\) must be passed in a bundle matrix \(T=(L_M-I)+U_M\), as returned by CSRRF_SUMLU. For the Cholesky mode, the lower triangular part of \(T\) must contain the Cholesky factor \(L_M\), and the strictly upper triangular part of \(T\) will be ignored. Similarly, the strictly upper triangular part of \(M\) is ignored when working in Cholesky mode.

Note
If only a refactorization will be executed (that is, without a solver phase), then nrhs can be set to zero and B can be null.
Parameters
[in]handle- rocblas_handle.
[in]n- rocblas_int. n >= 0. The number of rows (and columns) of matrix M.
[in]nrhs- rocblas_int. nrhs >= 0. The number of right-hand-sides (columns of matrix B). Set nrhs to zero when only the refactorization is needed.
[in]nnzM- rocblas_int. nnzM >= 0. The number of non-zero elements in M.
[in]ptrM- pointer to rocblas_int. Array on the GPU of dimension n+1. It contains the positions of the beginning of each row in indM and valM. The last element of ptrM is equal to nnzM.
[in]indM- pointer to rocblas_int. Array on the GPU of dimension nnzM. It contains the column indices of the non-zero elements of M. Indices are sorted by row and by column within each row.
[in]valM- pointer to type. Array on the GPU of dimension nnzM. The values of the non-zero elements of M. The strictly upper triangular entries are not referenced when working in Cholesky mode.
[in]nnzT- rocblas_int. nnzT >= 0. The number of non-zero elements in T.
[in]ptrT- pointer to rocblas_int. Array on the GPU of dimension n+1. It contains the positions of the beginning of each row in indT and valT. The last element of ptrT is equal to nnzT.
[in]indT- pointer to rocblas_int. Array on the GPU of dimension nnzT. It contains the column indices of the non-zero elements of T. Indices are sorted by row and by column within each row.
[in]valT- pointer to type. Array on the GPU of dimension nnzT. The values of the non-zero elements of T. The strictly upper triangular entries are not referenced when working in Cholesky mode.
[in]pivP- pointer to rocblas_int. Array on the GPU of dimension n. Contains the pivot indices representing the permutation matrix P, that is, the order in which the rows of matrix M were rearranged. When working in Cholesky mode, this array is not referenced and can be null.
[in]pivQ- pointer to rocblas_int. Array on the GPU of dimension n. Contains the pivot indices representing the permutation matrix Q, that is, the order in which the columns of matrix M were rearranged.
[in]B- pointer to type. Array on the GPU of dimension ldb*nrhs. The right hand side matrix B. It can be null if only the refactorization is needed.
[in]ldb- rocblas_int. ldb >= n. The leading dimension of B.
[out]rfinfo- rocsolver_rfinfo. Structure that holds the meta data generated in the analysis phase.

Member Function/Subroutine Documentation

◆ rocsolver_scsrrf_analysis_()

integer(kind(rocblas_status_success)) function hipfort_rocsolver::rocsolver_scsrrf_analysis::rocsolver_scsrrf_analysis_ ( type(c_ptr), value  handle,
integer(c_int), value  n,
integer(c_int), value  nrhs,
integer(c_int), value  nnzm,
type(c_ptr), value  ptrm,
type(c_ptr), value  indm,
type(c_ptr), value  valm,
integer(c_int), value  nnzt,
type(c_ptr), value  ptrt,
type(c_ptr), value  indt,
type(c_ptr), value  valt,
type(c_ptr), value  pivp,
type(c_ptr), value  pivq,
type(c_ptr), value  b,
integer(c_int), value  ldb,
type(c_ptr), value  rfinfo 
)

The documentation for this interface was generated from the following file: