9 if (!Mpp || !sym || !LD || !work)
return FAIL;
11 ladel_int row, col, index, ncol = Mpp->
ncol, start, index_in_pattern;
20 L->
p[0] = col_pointers[0] = 0;
21 for (index = 1; index < ncol; index++)
22 L->
p[index] = col_pointers[index] = sym->
col_counts[index-1];
26 for (col = 0; col < ncol; col++)
29 rhs[Mpp->
i[index]] = Mpp->
x[index];
35 for (index_in_pattern = start; index_in_pattern < ncol; index_in_pattern++)
37 row = pattern[index_in_pattern];
39 L_elem = Dinv[row]*temp;
40 diag_elem -= L_elem*temp;
44 for (index = L->
p[row]; index < col_pointers[row]; index++)
45 rhs[L->
i[index]] -= L->
x[index]*temp;
47 index = col_pointers[row];
55 ladel_print(
"LADEL ERROR: MATRIX (POSSIBLY) NOT FULL RANK (diagonal element of %le)\n", diag_elem);
60 Dinv[col] = 1/diag_elem;
63 for (index = 0; index < ncol; index++) L->
nz[index] = col_pointers[index] - L->
p[index];
#define SUCCESS
For status returns.
#define FAIL
For status returns.
#define LADEL_FOR(index, M, col)
Loop through a column of a sparse matrix.
#define LADEL_ABS(a)
Return the absolute value a number.
Constants and macros used in LADEL.
Routines to print out matrices and vectors.
Memory allocation routines.
#define ladel_print
Print function.
ladel_int ladel_ldl_numeric(ladel_sparse_matrix *Mpp, ladel_symbolics *sym, ladel_factor *LD, ladel_work *work)
Numerical part of the factorization of .
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 .
Routines to compute the pattern of the result of a backsolve.
ladel_int ladel_nonzero_pattern_of_row_in_L(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_int row)
Computes the pattern of the (next) row in L.
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 ncol
number of columns
ladel_double * x
numerical values (size nzmax)
ladel_int * p
column pointers (size ncol+1)
ladel_int * nz
(optional) number of elements in each column (size ncol)
ladel_int * i
row pointers (size nzmax)
Structure representing a multiple of the identity matrix.
ladel_double diag_elem
Scalar.
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)
ladel_double * D
D in LDL' factorization (stored as vector), not used but is useful for returning.
Workspace required for various routines in LADEL.
ladel_int * array_int_ncol1
An array of ncol integers.
ladel_double * array_double_all_zeros_ncol1
An array of ncol doubles, on input and output this should be all zeros.