QPALM 1.1.0
Proximal Augmented Lagrangian method for Quadratic Programs
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(...)   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...
 

Macro Definition Documentation

◆ c_absval

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

absolute value

Definition at line 88 of file global_opts.h.

◆ c_acos

#define c_acos   acos

arc cosine

Definition at line 110 of file global_opts.h.

◆ c_cos

#define c_cos   cos

cosine

Definition at line 111 of file global_opts.h.

◆ c_max

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

maximum of two values

Definition at line 92 of file global_opts.h.

◆ c_min

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

minimum of two values

Definition at line 96 of file global_opts.h.

◆ c_sqrt

#define c_sqrt   sqrt

square root

Definition at line 109 of file global_opts.h.

◆ mod

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

modulo operation (positive result for all values)

Definition at line 100 of file global_opts.h.

◆ qpalm_eprint

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

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

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

QPALM_EXPORT 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_free()

QPALM_EXPORT void qpalm_free ( void *  ptr)

Definition at line 16 of file global_opts.c.

+ Here is the caller graph for this function:

◆ qpalm_malloc()

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

QPALM_EXPORT void * qpalm_realloc ( void *  ptr,
size_t  size 
)

Definition at line 11 of file global_opts.c.

◆ qpalm_set_alloc_config_calloc()

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

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

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

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

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.