#include <R_ext/RS.h>
#include <R_ext/Memory.h>
Go to the source code of this file.
Functions | |
void | R_ldl_symbolic (int n, const int Ap[], const int Ai[], int Lp[], int Parent[], const int P[], int Pinv[]) |
int | R_ldl_numeric (int n, const int Ap[], const int Ai[], const double Ax[], const int Lp[], const int Parent[], int Li[], double Lx[], double D[], const int P[], const int Pinv[]) |
void | R_ldl_lsolve (int n, double X[], const int Lp[], const int Li[], const double Lx[]) |
void | R_ldl_dsolve (int n, double X[], const double D[]) |
void | R_ldl_ltsolve (int n, double X[], const int Lp[], const int Li[], const double Lx[]) |
void | R_ldl_perm (int n, double X[], const double B[], const int P[]) |
void | R_ldl_permt (int n, double X[], const double B[], const int P[]) |
int | R_ldl_valid_perm (int n, const int P[]) |
int | R_ldl_valid_matrix (int n, const int Ap[], const int Ai[]) |
|
solve Dx=b
|
|
solve Lx=b
|
|
solve L'x=b
|
|
Given a sparse matrix A (the arguments n, Ap, Ai, and Ax) and its symbolic analysis (Lp and Parent, and optionally P and Pinv), compute the numeric LDL' factorization of A or PAP'. The outputs of this routine are arguments Li, Lx, and D.
|
|
permute a vector, x=Pb
|
|
permute a vector, x=P'b
|
|
The input to this routine is a sparse matrix A, stored in column form, and an optional permutation P. The output is the elimination tree and the number of nonzeros in each column of L. Parent [i] = k if k is the parent of i in the tree. The Parent array is required by R_ldl_numeric. Lnz [k] gives the number of nonzeros in the kth column of L, excluding the diagonal. If P is NULL, then it is ignored. The factorization will be LDL' = A. Pinv is not computed. In this case, neither P nor Pinv are required by R_ldl_numeric. If P is not NULL, then it is assumed to be a valid permutation. If row and column j of A is the kth pivot, the P [k] = j. The factorization will be LDL' = PAP', or A (p,p) in MATLAB notation. The inverse permutation Pinv is computed, where Pinv [j] = k if P [k] = j. In this case, both P and Pinv are required as inputs to R_ldl_numeric. The floating-point operation count of the subsequent call to R_ldl_numeric is not returned, but could be computed after R_ldl_symbolic is done. It is the sum of (Lnz [k]) * (Lnz [k] + 2) for k = 0 to n-1.
|
|
This routine checks to see if a sparse matrix A is valid for input to R_ldl_symbolic and R_ldl_numeric. It returns 1 if the matrix is valid, 0 otherwise. A is in sparse column form. The numerical values in column j are stored in Ax [Ap [j] ... Ap [j+1]-1], with row indices in Ai [Ap [j] ... Ap [j+1]-1]. The Ax array is not checked.
|
|
Check if a permutation vector is valid
|