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(...) qpalm_print("ERROR in %s: ", __FUNCTION__); qpalm_print(__VA_ARGS__); qpalm_print("\n"); |
Custom operations | |
#define | c_absval(x) (((x) < 0) ? -(x) : (x)) |
absolute value More... | |
#define | c_max(a, b) (((a) > (b)) ? (a) : (b)) |
maximum of two values More... | |
#define | c_min(a, b) (((a) < (b)) ? (a) : (b)) |
minimum of two values More... | |
#define | mod(a, b) ((((a)%(b))+(b))%(b)) |
modulo operation (positive result for all values) More... | |
#define | c_sqrt sqrt |
square root More... | |
#define | c_acos acos |
arc cosine More... | |
#define | c_cos cos |
cosine More... | |
Typedefs | |
typedef ladel_double | c_float |
type for floating point numbers More... | |
typedef ladel_int | c_int |
type for integer numbers More... | |
Functions | |
Custom memory allocation (e.g. matlab/python) | |
QPALM_EXPORT void * | qpalm_calloc (size_t num, size_t size) |
QPALM_EXPORT void * | qpalm_malloc (size_t size) |
QPALM_EXPORT void * | qpalm_realloc (void *ptr, size_t size) |
QPALM_EXPORT void | qpalm_free (void *ptr) |
QPALM_EXPORT calloc_sig * | qpalm_set_alloc_config_calloc (calloc_sig *calloc) |
Set the calloc function used by QPALM. More... | |
QPALM_EXPORT malloc_sig * | qpalm_set_alloc_config_malloc (malloc_sig *malloc) |
Set the malloc function used by QPALM. More... | |
QPALM_EXPORT realloc_sig * | qpalm_set_alloc_config_realloc (realloc_sig *realloc) |
Set the realloc function used by QPALM. More... | |
QPALM_EXPORT free_sig * | qpalm_set_alloc_config_free (free_sig *free) |
Set the free function used by QPALM. More... | |
QPALM_EXPORT printf_sig * | qpalm_set_print_config_printf (printf_sig *printf) |
Set the printf function used by QPALM. More... | |
#define c_absval | ( | x | ) | (((x) < 0) ? -(x) : (x)) |
absolute value
Definition at line 88 of file global_opts.h.
#define c_acos acos |
arc cosine
Definition at line 110 of file global_opts.h.
#define c_cos cos |
cosine
Definition at line 111 of file global_opts.h.
#define c_max | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
maximum of two values
Definition at line 92 of file global_opts.h.
#define c_min | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
minimum of two values
Definition at line 96 of file global_opts.h.
#define c_sqrt sqrt |
square root
Definition at line 109 of file global_opts.h.
#define mod | ( | a, | |
b | |||
) | ((((a)%(b))+(b))%(b)) |
modulo operation (positive result for all values)
Definition at line 100 of file global_opts.h.
#define qpalm_eprint | ( | ... | ) | qpalm_print("ERROR in %s: ", __FUNCTION__); qpalm_print(__VA_ARGS__); qpalm_print("\n"); |
Definition at line 78 of file global_opts.h.
#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.
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.
QPALM_EXPORT void * qpalm_calloc | ( | size_t | num, |
size_t | size | ||
) |
Definition at line 3 of file global_opts.c.
QPALM_EXPORT void qpalm_free | ( | void * | ptr | ) |
Definition at line 16 of file global_opts.c.
QPALM_EXPORT void * qpalm_malloc | ( | size_t | size | ) |
Definition at line 7 of file global_opts.c.
QPALM_EXPORT void * qpalm_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 11 of file global_opts.c.
QPALM_EXPORT 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.
QPALM_EXPORT 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.
QPALM_EXPORT 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.
QPALM_EXPORT 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.
QPALM_EXPORT 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.