14 for (
int i = 0; i < n; i++)
21 for (
int i = 0; i < n; i++)
44 data->
q = random_vector(data->
n);
46 data->
bmin = constant_vector(-2, data->
m);
47 data->
bmax = constant_vector(2, data->
m);
50 A = ladel_sparse_alloc(M, N, ANZMAX, UNSYMMETRIC,
TRUE,
FALSE);
51 Q = ladel_sparse_alloc(N, N, QNZMAX, UPPER,
TRUE,
FALSE);
54 A->x[0] = 1; A->x[1] = 1; A->x[2] = 1; A->x[3] = 1;
55 A->p[0] = 0; A->p[1] = 2; A->p[2] = 4;
56 A->i[0] = 0; A->i[1] = 2; A->i[2] = 1; A->i[3] = 2;
57 Q->x[0] = 1.0; Q->x[1] = 1.5;
58 Q->p[0] = 0; Q->p[1] = 1; Q->p[2] = 2;
59 Q->i[0] = 0; Q->i[1] = 1;
73 printf(
"Solver status: ");
75 printf(
"Iter: %d\n", (
int)work->
info->
iter);
78 for (
c_int i = 0; i < n; i++)
88 ladel_sparse_free(data->
Q);
89 ladel_sparse_free(data->
A);
void qpalm_free(void *ptr)
void * qpalm_malloc(size_t size)
void * qpalm_calloc(size_t num, size_t size)
ladel_int c_int
type for integer numbers
ladel_double c_float
type for floating point numbers
void qpalm_solve(QPALMWorkspace *work)
Solve the quadratic program.
QPALMWorkspace * qpalm_setup(const QPALMData *data, const QPALMSettings *settings)
Initialize QPALM solver allocating memory.
void qpalm_set_default_settings(QPALMSettings *settings)
Set default settings from constants.h file.
void qpalm_cleanup(QPALMWorkspace *work)
Cleanup the workspace by deallocating memory.
size_t m
number of constraints m
c_float * bmin
dense array for lower bounds (size m)
c_float c
constant part of cost
size_t n
number of variables n
c_float * q
dense array for linear part of cost function (size n)
solver_sparse * A
sparse linear constraints matrix A (size m x n)
c_float * bmax
dense array for upper bounds (size m)
solver_sparse * Q
sparse quadratic part of the cost Q (size n x n)
c_float run_time
total time (seconds)
c_int iter_out
number of outer iterations (i.e. dual updates)
c_int iter
number of iterations taken
c_float solve_time
time taken for solve phase (seconds)
char status[32]
status string, e.g. 'solved'
c_float setup_time
time taken for setup phase (seconds)
c_float * x
primal solution
QPALMInfo * info
solver information
QPALMSolution * solution
problem solution
ladel_sparse_matrix solver_sparse