QPALM
A proximal augmented Lagrangian method for QPs.
|
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... | |
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.
#define c_absval | ( | x | ) | (((x) < 0) ? -(x) : (x)) |
absolute value
#define c_calloc calloc |
custom calloc
#define c_eprint | ( | ... | ) |
#define c_free free |
custom free
#define c_malloc malloc |
custom malloc
#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 c_print printf |
#define c_realloc realloc |
custom realloc
#define c_sqrt sqrt |
square root
#define mod | ( | a, | |
b | |||
) | ((((a)%(b))+(b))%(b)) |
modulo operation (positive result for all values)
typedef ladel_double c_float |
type for floating point numbers
typedef ladel_int c_int |
type for integer numbers