QPALM
A proximal augmented Lagrangian method for QPs.
Macros | Typedefs
global_opts.h File Reference

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

#include "ladel.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

Go to the source code of this file.

Macros

#define c_print   printf
 
#define c_eprint(...)
 
Custom memory allocation (e.g. matlab/python)
#define c_malloc   malloc
 custom malloc More...
 
#define c_calloc   calloc
 custom calloc More...
 
#define c_free   free
 custom free More...
 
#define c_realloc   realloc
 custom realloc More...
 
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...
 

Typedefs

typedef ladel_double c_float
 type for floating point numbers More...
 
typedef ladel_int c_int
 type for integer numbers More...
 

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.

Macro Definition Documentation

◆ c_absval

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

absolute value

◆ c_calloc

#define c_calloc   calloc

custom calloc

◆ c_eprint

#define c_eprint (   ...)
Value:
c_print("ERROR in %s: ", __FUNCTION__); c_print( \
__VA_ARGS__); c_print("\n");
#define c_print
Definition: global_opts.h:155

◆ c_free

#define c_free   free

custom free

◆ c_malloc

#define c_malloc   malloc

custom malloc

◆ c_max

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

maximum of two values

◆ c_min

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

minimum of two values

◆ c_print

#define c_print   printf

◆ c_realloc

#define c_realloc   realloc

custom realloc

◆ c_sqrt

#define c_sqrt   sqrt

square root

◆ mod

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

modulo operation (positive result for all values)

Typedef Documentation

◆ c_float

typedef ladel_double c_float

type for floating point numbers

◆ c_int

typedef ladel_int c_int

type for integer numbers