20 if (!M || !sym || !work)
return FAIL;
28 if (!Mpp)
return FAIL;
30 if (ok_symbolic ==
FAIL)
return FAIL;
38 if (!Mpp)
return FAIL;
42 if (ok_symbolic && ok_numeric)
return SUCCESS;
55 if (!M || !sym || !Mbasis || !work)
return FAIL;
63 if (!Mpp)
return FAIL;
86 if (ok_symbolic && ok_numeric)
return SUCCESS;
99 if (!M || !sym || !LD || !work)
return FAIL;
122 if (!LD || !rhs || !y || !work)
return FAIL;
127 if (LD->
p)
for (row = 0; row < ncol; row++) y[row] = rhs[LD->
p[row]];
128 else for (row = 0; row < ncol; row++) y[row] = rhs[row];
130 for (row = 0; row < ncol; row++)
132 for (index = L->
p[row]; index < L->p[row]+L->
nz[row]; index++)
134 y[L->
i[index]] -= L->
x[index]*y[row];
137 for (row = 0; row < ncol; row++) y[row] *= Dinv[row];
138 for (row = ncol-1; row >= 0; row--)
140 for (index = L->
p[row]; index < L->p[row]+L->
nz[row]; index++)
142 y[row] -= L->
x[index]*y[L->
i[index]];
149 for (row = 0; row < ncol; row++) temp[row] = y[row];
150 for (row = 0; row < ncol; row++)
152 y[LD->
p[row]] = temp[row];
#define NO_ORDERING
No ordering is performed during the symbolic part of the factorization.
#define SUCCESS
For status returns.
#define FALSE
For booleans.
#define FAIL
For status returns.
ladel_int ladel_dense_solve(const ladel_factor *LD, const ladel_double *rhs, ladel_double *y, ladel_work *work)
Computes .
ladel_int ladel_factorize_with_diag(ladel_sparse_matrix *M, ladel_diag d, ladel_symbolics *sym, ladel_int ordering_method, ladel_factor **LD, ladel_work *work)
Computes the factorization of .
ladel_int ladel_factorize(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_int ordering_method, ladel_factor **LD, ladel_work *work)
Computes the factorization of .
ladel_int ladel_factorize_with_prior_basis(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_factor *LD, ladel_work *work)
Computes the factorization of provided LD was allocated before.
ladel_int ladel_factorize_with_prior_basis_with_diag(ladel_sparse_matrix *M, ladel_diag d, ladel_symbolics *sym, ladel_factor *LD, ladel_work *work)
Computes the factorization of provided LD was allocated before.
ladel_int ladel_factorize_advanced(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_int ordering_method, ladel_factor **LD, ladel_sparse_matrix *Mbasis, ladel_work *work)
Computes the factorization of but allocates based on Mbasis.
ladel_int ladel_factorize_advanced_with_diag(ladel_sparse_matrix *M, ladel_diag d, ladel_symbolics *sym, ladel_int ordering_method, ladel_factor **LD, ladel_sparse_matrix *Mbasis, ladel_work *work)
Computes the factorization of but allocates based on Mbasis.
Constants and macros used in LADEL.
Routines to print out matrices and vectors.
Routines to compute the elimination tree of a matrix.
ladel_int ladel_etree(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_work *work)
Computes the elimination tree of a matrix.
Memory allocation routines.
ladel_sparse_matrix * ladel_sparse_alloc(ladel_int nrow, ladel_int ncol, ladel_int nzmax, ladel_int symmetry, ladel_int values, ladel_int nz)
Allocate a sparse matrix.
ladel_factor * ladel_factor_allocate(ladel_symbolics *sym)
Allocate a factors struct.
ladel_sparse_matrix * ladel_sparse_free(ladel_sparse_matrix *M)
Free a sparse matrix (and return NULL).
The numerical part of the factorization.
ladel_int ladel_ldl_numeric_with_diag(ladel_sparse_matrix *Mpp, ladel_diag d, ladel_symbolics *sym, ladel_factor *LD, ladel_work *work)
Numerical part of the factorization of .
The symbolic part of the factorization.
ladel_int ladel_ldl_symbolic(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_int ordering_method, ladel_sparse_matrix *Mpp, ladel_work *work)
Symbolic part of the factorization.
Routines to permute vectors and matrices.
void ladel_permute_symmetric_matrix(ladel_sparse_matrix *M, ladel_int *p, ladel_sparse_matrix *Mpp, ladel_work *work)
Compute .
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
double ladel_double
Type for floating point numbers (default: double)
Sparse matrix in compressed column storage.
ladel_int symmetry
type of symmetry (UNSYMMETRIC, UPPER or LOWER)
ladel_int ncol
number of columns
ladel_double * x
numerical values (size nzmax)
ladel_int nzmax
number of nonzeros
ladel_int * p
column pointers (size ncol+1)
ladel_int * nz
(optional) number of elements in each column (size ncol)
ladel_int values
has numerical values
ladel_int nrow
number of rows
ladel_int * i
row pointers (size nzmax)
Structure representing a multiple of the identity matrix.
ladel_int diag_size
Size of the matrix.
Factors of an factorization.
ladel_int * p
permutation vector
ladel_sparse_matrix * L
L in LDL' factorization.
ladel_double * Dinv
D^-1 in LDL' factorization (stored as vector)
Workspace required for various routines in LADEL.
ladel_double * array_double_all_zeros_ncol1
An array of ncol doubles, on input and output this should be all zeros.