32 #ifdef QPALM_FORTRAN_DEBUG_PRINT
46 for (
int i = 0; i < n; i++) {
49 for (
int i = 0; i < m; i++) {
50 data->
bmin[i] = c_l[i];
51 data->
bmax[i] = c_u[i];
65 #ifdef QPALM_FORTRAN_DEBUG_PRINT
72 ladel_sparse_matrix *A;
74 A = ladel_sparse_alloc( a_nrow, a_ncol, a_nzmax, a_symmetry,
TRUE,
FALSE );
76 #ifdef QPALM_FORTRAN_DEBUG_PRINT
92 for (
int i = 0; i < n+1; i++) {
94 #ifdef QPALM_FORTRAN_DEBUG_PRINT
95 printf(
"A column pointer %i = %i \n",i, A->p[i]);
98 for (
int i = 0; i < a_ne; i++) {
100 #ifdef QPALM_FORTRAN_DEBUG_PRINT
101 printf(
"A row index %i = %i \n",i, A->i[i]);
104 for (
int i = 0; i < a_ne; i++) {
106 #ifdef QPALM_FORTRAN_DEBUG_PRINT
107 printf(
"A value %i = %.10f \n",i, A->x[i]);
117 ladel_int q_symmetry;
124 #ifdef QPALM_FORTRAN_DEBUG_PRINT
125 printf(
"nrow = %li \n",q_nrow);
126 printf(
"ncol = %li \n",q_ncol);
127 printf(
"nzmax = %li \n",q_nzmax);
131 ladel_sparse_matrix *Q;
133 Q = ladel_sparse_alloc( q_nrow, q_ncol, q_nzmax, q_symmetry,
TRUE,
FALSE );
135 #ifdef QPALM_FORTRAN_DEBUG_PRINT
136 printf(
"nrow = %li \n",Q->nrow);
137 printf(
"ncol = %li \n",Q->ncol);
138 printf(
"nzmax = %li \n",Q->nzmax);
139 printf(
"symmetry = %li \n",Q->symmetry);
140 printf(
"values = %li \n",Q->values);
151 for (
int i = 0; i < n+1; i++) {
153 #ifdef QPALM_FORTRAN_DEBUG_PRINT
154 printf(
"Q column pointer %i = %i \n",i, Q->p[i]);
157 for (
int i = 0; i < h_ne; i++) {
159 #ifdef QPALM_FORTRAN_DEBUG_PRINT
160 printf(
"Q row index %i = %i \n",i, Q->i[i]);
163 for (
int i = 0; i < h_ne; i++) {
165 #ifdef QPALM_FORTRAN_DEBUG_PRINT
166 printf(
"Q value %i = %.10f \n",i, Q->x[i]);
179 if ( settings_c.
verbose == 1 ) {
191 for (
int i = 0; i < n; i++) {
195 for (
int i = 0; i < m; i++) {
201 *info_c = *work->
info;
204 data->
Q = ladel_sparse_free(data->
Q);
205 data->
A = ladel_sparse_free(data->
A);
void qpalm_free(void *ptr)
void * qpalm_malloc(size_t size)
ladel_int c_int
type for integer numbers
ladel_double c_float
type for floating point numbers
void qpalm_cleanup(QPALMWorkspace *work)
Cleanup the workspace by deallocating memory.
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_fortran_c(f_int n, f_int m, f_int h_ne, f_int H_ptr[], f_int H_row[], f_float H_val[], f_float g[n], f_float f, f_int a_ne, f_int A_ptr[], f_int A_row[], f_float A_val[], f_float c_l[], f_float c_u[], QPALMSettings settings_c, f_float x[], f_float y[], QPALMInfo *info_c)
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)
Solver return information.
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_int verbose
boolean, write out progress
c_float * x
primal iterate
QPALMInfo * info
solver information