Memory allocation routines.
Definition in file ladel_global.h.
Go to the source code of this file.
Macros | |
#define | LADEL_ATTR_PRINTF_LIKE |
#define | ladel_print ladel_get_print_config_printf() |
Print function. More... | |
Typedefs | |
typedef void *() | calloc_sig(size_t, size_t) |
typedef void *() | malloc_sig(size_t) |
typedef void *() | realloc_sig(void *, size_t) |
typedef void() | free_sig(void *) |
typedef LADEL_ATTR_PRINTF_LIKE int() | printf_sig(const char *,...) |
Functions | |
calloc_sig * | ladel_set_alloc_config_calloc (calloc_sig *calloc) |
Set the calloc function used by LADEL. More... | |
malloc_sig * | ladel_set_alloc_config_malloc (malloc_sig *malloc) |
Set the malloc function used by LADEL. More... | |
realloc_sig * | ladel_set_alloc_config_realloc (realloc_sig *realloc) |
Set the realloc function used by LADEL. More... | |
free_sig * | ladel_set_alloc_config_free (free_sig *free) |
Set the free function used by LADEL. More... | |
void * | ladel_malloc (ladel_int n, size_t size) |
Version of malloc (for mex or for regular C). More... | |
void * | ladel_calloc (ladel_int n, size_t size) |
Version of calloc (for mex or for regular C). More... | |
void * | ladel_free (void *p) |
Version of free (for mex or for regular C). More... | |
void * | ladel_realloc (void *p, ladel_int n, size_t size, ladel_int *status) |
Version of realloc (for mex or for regular C). More... | |
printf_sig * | ladel_set_print_config_printf (printf_sig *printf) |
Set the printf function used by LADEL. More... | |
printf_sig * | ladel_get_print_config_printf (void) |
Get the printf function used by LADEL. More... | |
ladel_sparse_matrix * | ladel_sparse_free (ladel_sparse_matrix *M) |
Free a sparse matrix (and return NULL). More... | |
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. More... | |
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). More... | |
ladel_int | ladel_sparse_realloc (ladel_sparse_matrix *M, ladel_int nzmax) |
Reallocate a sparse matrix with a new size. More... | |
ladel_symbolics * | ladel_symbolics_free (ladel_symbolics *sym) |
Free a symbolics struct (and return NULL). More... | |
ladel_symbolics * | ladel_symbolics_alloc (ladel_int ncol) |
Allocate a symbolics struct. More... | |
ladel_factor * | ladel_factor_free (ladel_factor *LD) |
Free a factor. More... | |
ladel_factor * | ladel_factor_allocate (ladel_symbolics *sym) |
Allocate a factors struct. More... | |
ladel_set * | ladel_set_free (ladel_set *set) |
Free a set. More... | |
ladel_set * | ladel_set_allocate (ladel_int max_size) |
Allocate a set struct. More... | |
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. More... | |
ladel_work * | ladel_workspace_free (ladel_work *work) |
Free a LADEL workspace. More... | |
ladel_work * | ladel_workspace_allocate (ladel_int ncol) |
Allocate a LADEL workspace. More... | |
#define LADEL_ATTR_PRINTF_LIKE |
Definition at line 84 of file ladel_global.h.
#define ladel_print ladel_get_print_config_printf() |
Print function.
Definition at line 97 of file ladel_global.h.
typedef void *() calloc_sig(size_t, size_t) |
Definition at line 19 of file ladel_global.h.
typedef void() free_sig(void *) |
Definition at line 22 of file ladel_global.h.
typedef void *() malloc_sig(size_t) |
Definition at line 20 of file ladel_global.h.
typedef LADEL_ATTR_PRINTF_LIKE int() printf_sig(const char *,...) |
Definition at line 87 of file ladel_global.h.
typedef void *() realloc_sig(void *, size_t) |
Definition at line 21 of file ladel_global.h.
void * ladel_calloc | ( | ladel_int | n, |
size_t | size | ||
) |
Version of calloc (for mex or for regular C).
If the calloc fails, this function will return NULL.
n | Number of blocks |
size | Size of block |
Definition at line 56 of file ladel_global.c.
ladel_factor * ladel_factor_allocate | ( | ladel_symbolics * | sym | ) |
Allocate a factors struct.
sym | Symbolics struct |
Definition at line 194 of file ladel_global.c.
ladel_factor * ladel_factor_free | ( | ladel_factor * | LD | ) |
Free a factor.
LD | Factors of an \(LDL^T\) factorization |
Definition at line 183 of file ladel_global.c.
void * ladel_free | ( | void * | p | ) |
Version of free (for mex or for regular C).
p | Pointer to the memory to be freed |
Definition at line 60 of file ladel_global.c.
printf_sig * ladel_get_print_config_printf | ( | void | ) |
Get the printf
function used by LADEL.
Definition at line 87 of file ladel_global.c.
void * ladel_malloc | ( | ladel_int | n, |
size_t | size | ||
) |
Version of malloc (for mex or for regular C).
If the malloc fails, this function will return NULL.
n | Number of blocks |
size | Size of block |
Definition at line 52 of file ladel_global.c.
Version of realloc (for mex or for regular C).
If the realloc fails, this function will return the original pointer.
p | Pointer to the memory |
n | Number of blocks |
size | Size of block |
status | Status to indicate success |
Definition at line 66 of file ladel_global.c.
calloc_sig * ladel_set_alloc_config_calloc | ( | calloc_sig * | calloc | ) |
Set the calloc
function used by LADEL.
Definition at line 24 of file ladel_global.c.
Set the free
function used by LADEL.
Definition at line 45 of file ladel_global.c.
malloc_sig * ladel_set_alloc_config_malloc | ( | malloc_sig * | malloc | ) |
Set the malloc
function used by LADEL.
Definition at line 31 of file ladel_global.c.
realloc_sig * ladel_set_alloc_config_realloc | ( | realloc_sig * | realloc | ) |
Set the realloc
function used by LADEL.
Definition at line 38 of file ladel_global.c.
Allocate a set struct.
max_size | Maximum size of the set |
Definition at line 233 of file ladel_global.c.
Free a set.
set | Set to be freed |
Definition at line 226 of file ladel_global.c.
printf_sig * ladel_set_print_config_printf | ( | printf_sig * | printf | ) |
Set the printf
function used by LADEL.
Definition at line 80 of file ladel_global.c.
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.
set | Set to be filled in |
set_vals | Array that represents the set |
size_set | Current size of the set |
max_size_set | Maximum size of the set |
Definition at line 247 of file ladel_global.c.
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.
nrow | Number of rows |
ncol | Number of columns |
nzmax | Maximum number of nonzeros |
symmetry | UNSYMMETRIC, or store only UPPER part of a matrix |
values | Indicate value or pattern matrix |
nz | Indicate the use of the nz field to list nonzeros per column |
Definition at line 101 of file ladel_global.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).
nrow | Number of rows |
ncol | Number of columns |
symmetry | UNSYMMETRIC, or store only UPPER part of a matrix |
values | Indicate value or pattern matrix |
nz | Indicate the use of the nz field to list nonzeros per column |
Definition at line 122 of file ladel_global.c.
ladel_sparse_matrix * ladel_sparse_free | ( | ladel_sparse_matrix * | M | ) |
Free a sparse matrix (and return NULL).
M | Matrix to be freed |
Definition at line 91 of file ladel_global.c.
ladel_int ladel_sparse_realloc | ( | ladel_sparse_matrix * | M, |
ladel_int | nzmax | ||
) |
Reallocate a sparse matrix with a new size.
M | Sparse matrix |
nzmax | New maximum number of nonzeros |
Definition at line 141 of file ladel_global.c.
ladel_symbolics * ladel_symbolics_alloc | ( | ladel_int | ncol | ) |
Allocate a symbolics struct.
ncol | Number of columns of matrix to be analyzed |
Definition at line 166 of file ladel_global.c.
ladel_symbolics * ladel_symbolics_free | ( | ladel_symbolics * | sym | ) |
Free a symbolics struct (and return NULL).
sym | Symbolics struct |
Definition at line 153 of file ladel_global.c.
ladel_work * ladel_workspace_allocate | ( | ladel_int | ncol | ) |
Allocate a LADEL workspace.
ncol | Size of the structures in the workspace (= ncol of matrix to be factorized) |
Definition at line 273 of file ladel_global.c.
ladel_work * ladel_workspace_free | ( | ladel_work * | work | ) |
Free a LADEL workspace.
work | LADEL workspace to be freed |
Definition at line 254 of file ladel_global.c.