QPALM
main
Proximal Augmented Lagrangian method for Quadratic Programs
|
Custom memory allocation, print and utility functions, and data types for floats and ints.
Memory allocation and print functions depend on whether the code is compiled as a standalone library or with matlab or python. The data types used for floating point numbers and integer numbers can be changed here as well. Finally, some customized operations (max, min, mod and abs) are included as well.
Definition in file global_opts.h.
#include <ladel.h>
#include <math.h>
Go to the source code of this file.
Macros | |
#define | QPALM_EXPORT __attribute__((visibility("default"))) |
#define | qpalm_print ladel_print |
#define | qpalm_eprint(...) do { qpalm_print("ERROR in %s: ", __FUNCTION__); qpalm_print(__VA_ARGS__); qpalm_print("\n"); } while (0) |
Custom operations | |
#define | c_absval(x) (((x) < 0) ? -(x) : (x)) |
absolute value | |
#define | c_max(a, b) (((a) > (b)) ? (a) : (b)) |
maximum of two values | |
#define | c_min(a, b) (((a) < (b)) ? (a) : (b)) |
minimum of two values | |
#define | mod(a, b) ((((a)%(b))+(b))%(b)) |
modulo operation (positive result for all values) | |
#define | c_sqrt sqrt |
square root | |
#define | c_acos acos |
arc cosine | |
#define | c_cos cos |
cosine | |
Typedefs | |
typedef ladel_double | c_float |
type for floating point numbers | |
typedef ladel_int | c_int |
type for integer numbers | |
Functions | |
Custom memory allocation (e.g. matlab/python) | |
void * | qpalm_calloc (size_t num, size_t size) |
void * | qpalm_malloc (size_t size) |
void * | qpalm_realloc (void *ptr, size_t size) |
void | qpalm_free (void *ptr) |
calloc_sig * | qpalm_set_alloc_config_calloc (calloc_sig *calloc) |
Set the calloc function used by QPALM. | |
malloc_sig * | qpalm_set_alloc_config_malloc (malloc_sig *malloc) |
Set the malloc function used by QPALM. | |
realloc_sig * | qpalm_set_alloc_config_realloc (realloc_sig *realloc) |
Set the realloc function used by QPALM. | |
free_sig * | qpalm_set_alloc_config_free (free_sig *free) |
Set the free function used by QPALM. | |
printf_sig * | qpalm_set_print_config_printf (printf_sig *printf) |
Set the printf function used by QPALM. | |
#define QPALM_EXPORT __attribute__((visibility("default"))) |
Definition at line 33 of file global_opts.h.
#define qpalm_print ladel_print |
Definition at line 75 of file global_opts.h.
#define qpalm_eprint | ( | ... | ) | do { qpalm_print("ERROR in %s: ", __FUNCTION__); qpalm_print(__VA_ARGS__); qpalm_print("\n"); } while (0) |
Definition at line 81 of file global_opts.h.
#define c_absval | ( | x | ) | (((x) < 0) ? -(x) : (x)) |
absolute value
Definition at line 92 of file global_opts.h.
#define c_max | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
maximum of two values
Definition at line 96 of file global_opts.h.
#define c_min | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
minimum of two values
Definition at line 100 of file global_opts.h.
#define mod | ( | a, | |
b | |||
) | ((((a)%(b))+(b))%(b)) |
modulo operation (positive result for all values)
Definition at line 104 of file global_opts.h.
#define c_sqrt sqrt |
square root
Definition at line 113 of file global_opts.h.
#define c_acos acos |
arc cosine
Definition at line 114 of file global_opts.h.
#define c_cos cos |
cosine
Definition at line 115 of file global_opts.h.
typedef ladel_double c_float |
type for floating point numbers
Definition at line 41 of file global_opts.h.
typedef ladel_int c_int |
type for integer numbers
Definition at line 42 of file global_opts.h.
void * qpalm_calloc | ( | size_t | num, |
size_t | size | ||
) |
void * qpalm_malloc | ( | size_t | size | ) |
void * qpalm_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 11 of file global_opts.c.
void qpalm_free | ( | void * | ptr | ) |
calloc_sig * qpalm_set_alloc_config_calloc | ( | calloc_sig * | calloc | ) |
Set the calloc
function used by QPALM.
Definition at line 20 of file global_opts.c.
malloc_sig * qpalm_set_alloc_config_malloc | ( | malloc_sig * | malloc | ) |
Set the malloc
function used by QPALM.
Definition at line 23 of file global_opts.c.
realloc_sig * qpalm_set_alloc_config_realloc | ( | realloc_sig * | realloc | ) |
Set the realloc
function used by QPALM.
Definition at line 26 of file global_opts.c.
free_sig * qpalm_set_alloc_config_free | ( | free_sig * | free | ) |
Set the free
function used by QPALM.
Definition at line 29 of file global_opts.c.
printf_sig * qpalm_set_print_config_printf | ( | printf_sig * | printf | ) |
Set the printf
function used by QPALM.
Definition at line 32 of file global_opts.c.