62 ladel_alloc_config.
free(p);
69 *status = (p_new != NULL);
70 return (*status) ? p_new : p;
88 return ladel_print_config.
printf;
145 if (nzmax <= 0) nzmax = M->
p[M->
ncol];
148 status = status_i && status_x;
155 if (!sym)
return NULL;
169 if (!sym)
return NULL;
185 if (!LD)
return NULL;
197 if (!LD || !sym)
return NULL;
202 if (!LD->
L || !LD->
D || !LD->
Dinv)
211 if (!LD->
p || !LD->
pinv)
228 if (!set)
return NULL;
236 if (!set)
return NULL;
256 if (!work)
return NULL;
276 if (!work)
return NULL;
#define UNSYMMETRIC
No symmetry is assumed in the matrix.
#define TRUE
For booleans.
#define SUCCESS
For status returns.
#define FAIL
For status returns.
#define LADEL_MAX(a, b)
Return the maximum of two numbers.
Constants and macros used in LADEL.
Routines to copy matrices and vectors.
void ladel_int_vector_copy(ladel_int *x, ladel_int size, ladel_int *y)
Copies an integer vector (preallocated)
ladel_work * ladel_workspace_free(ladel_work *work)
Free a LADEL workspace.
void * ladel_calloc(ladel_int n, size_t size)
Version of calloc (for mex or for regular C).
malloc_sig * ladel_set_alloc_config_malloc(malloc_sig *malloc)
Set the malloc function used by LADEL.
calloc_sig * ladel_set_alloc_config_calloc(calloc_sig *calloc)
Set the calloc function used by LADEL.
ladel_factor * ladel_factor_free(ladel_factor *LD)
Free a factor.
ladel_symbolics * ladel_symbolics_free(ladel_symbolics *sym)
Free a symbolics struct (and return NULL).
printf_sig * ladel_set_print_config_printf(printf_sig *printf)
Set the printf function used by LADEL.
realloc_sig * ladel_set_alloc_config_realloc(realloc_sig *realloc)
Set the realloc function used by LADEL.
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.
void ladel_set_set(ladel_set *set, ladel_int *set_vals, ladel_int size_set, ladel_int max_size_set)
Fill in the fields of the given set.
ladel_symbolics * ladel_symbolics_alloc(ladel_int ncol)
Allocate a symbolics struct.
ladel_set * ladel_set_allocate(ladel_int max_size)
Allocate a set struct.
void * ladel_realloc(void *p, ladel_int n, size_t size, ladel_int *status)
Version of realloc (for mex or for regular C).
void * ladel_malloc(ladel_int n, size_t size)
Version of malloc (for mex or for regular C).
ladel_sparse_matrix * ladel_sparse_alloc_empty(ladel_int nrow, ladel_int ncol, ladel_int symmetry, ladel_int values, ladel_int nz)
Allocate a sparse empty matrix (used in special cases).
void * ladel_free(void *p)
Version of free (for mex or for regular C).
ladel_work * ladel_workspace_allocate(ladel_int ncol)
Allocate a LADEL workspace.
ladel_factor * ladel_factor_allocate(ladel_symbolics *sym)
Allocate a factors struct.
printf_sig * ladel_get_print_config_printf(void)
Get the printf function used by LADEL.
free_sig * ladel_set_alloc_config_free(free_sig *free)
Set the free function used by LADEL.
ladel_set * ladel_set_free(ladel_set *set)
Free a set.
ladel_int ladel_sparse_realloc(ladel_sparse_matrix *M, ladel_int nzmax)
Reallocate a sparse matrix with a new size.
ladel_sparse_matrix * ladel_sparse_free(ladel_sparse_matrix *M)
Free a sparse matrix (and return NULL).
Memory allocation routines.
void *() malloc_sig(size_t)
void *() calloc_sig(size_t, size_t)
LADEL_ATTR_PRINTF_LIKE int() printf_sig(const char *,...)
void *() realloc_sig(void *, size_t)
Routines to permute vectors and matrices.
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)
ladel_int max_size_set
Maximum (allocated) size of the list.
ladel_int * set
List of integers representing the set.
ladel_int size_set
Size of the list.
Factors of an factorization.
ladel_int ncol
number of columns in the analyzed matrix
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.
ladel_int * pinv
inverse permutation vector
Workspace required for various routines in LADEL.
ladel_int * array_int_ncol2
An array of ncol integers.
ladel_set * set_unallocated_values3
An unallocated set structure.
ladel_set * set_preallocated2
A preallocated set structure.
ladel_int flag
Flag used to mark nodes, used in conjunction with array_int_ncol_flag.
ladel_int * array_int_ncol1
An array of ncol integers.
ladel_int * array_int_ncol_flag
An array of ncol integers, assumed to be < flag.
ladel_int * array_int_ncol3
An array of ncol integers.
ladel_int * array_int_ncol4
An array of ncol integers.
ladel_set * set_unallocated_values2
An unallocated set structure.
ladel_double * array_double_all_zeros_ncol1
An array of ncol doubles, on input and output this should be all zeros.
ladel_set * set_preallocated1
A preallocated set structure.
ladel_double * array_double_ncol1
An array of ncol doubles.
ladel_set * set_preallocated3
A preallocated set structure.
ladel_set * set_unallocated_values1
An unallocated set structure.