QPALM 1.2.5
Proximal Augmented Lagrangian method for Quadratic Programs
Loading...
Searching...
No Matches
Macros | Typedefs
global_opts.h File Reference

Detailed Description

Custom memory allocation, print and utility functions, and data types for floats and ints.

Author
Ben Hermans

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>
+ Include dependency graph for global_opts.h:
+ This graph shows which files directly or indirectly include this file:

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.
 

Macro Definition Documentation

◆ QPALM_EXPORT

#define QPALM_EXPORT   __attribute__((visibility("default")))

Definition at line 33 of file global_opts.h.

◆ qpalm_print

#define qpalm_print   ladel_print

Definition at line 75 of file global_opts.h.

◆ qpalm_eprint

#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.

◆ c_absval

#define c_absval (   x)    (((x) < 0) ? -(x) : (x))

absolute value

Definition at line 92 of file global_opts.h.

◆ c_max

#define c_max (   a,
 
)    (((a) > (b)) ? (a) : (b))

maximum of two values

Definition at line 96 of file global_opts.h.

◆ c_min

#define c_min (   a,
 
)    (((a) < (b)) ? (a) : (b))

minimum of two values

Definition at line 100 of file global_opts.h.

◆ mod

#define mod (   a,
 
)    ((((a)%(b))+(b))%(b))

modulo operation (positive result for all values)

Definition at line 104 of file global_opts.h.

◆ c_sqrt

#define c_sqrt   sqrt

square root

Definition at line 113 of file global_opts.h.

◆ c_acos

#define c_acos   acos

arc cosine

Definition at line 114 of file global_opts.h.

◆ c_cos

#define c_cos   cos

cosine

Definition at line 115 of file global_opts.h.

Typedef Documentation

◆ c_float

typedef ladel_double c_float

type for floating point numbers

Examples
examples/c/qpalm_demo.c.

Definition at line 41 of file global_opts.h.

◆ c_int

typedef ladel_int c_int

type for integer numbers

Definition at line 42 of file global_opts.h.

Function Documentation

◆ qpalm_calloc()

void * qpalm_calloc ( size_t  num,
size_t  size 
)

Definition at line 3 of file global_opts.c.

+ Here is the caller graph for this function:

◆ qpalm_malloc()

void * qpalm_malloc ( size_t  size)

Definition at line 7 of file global_opts.c.

+ Here is the caller graph for this function:

◆ qpalm_realloc()

void * qpalm_realloc ( void *  ptr,
size_t  size 
)

Definition at line 11 of file global_opts.c.

◆ qpalm_free()

void qpalm_free ( void *  ptr)

Definition at line 16 of file global_opts.c.

+ Here is the caller graph for this function:

◆ qpalm_set_alloc_config_calloc()

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_set_alloc_config_malloc()

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_set_alloc_config_realloc()

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_set_alloc_config_free()

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_set_print_config_printf()

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.