qpSWIFT
A Sparse Quadratic Programming Solver
Matrices.h
Go to the documentation of this file.
1 #ifndef __MATRICES_H__
2 #define __MATRICES_H__
3 #include "GlobalOptions.h"
4 
5  /* Using the default value of 0.0 */
6  qp_real sigma_d = 0.0;
7 
8  /* Cost Function P Matrix in CCS format */
9  qp_real Ppr[7] = {5.0, 1.0, 1.0, 2.0, 1.0, 1.0, 4.0};
10  qp_int Pir[7] = {0, 1, 0, 1, 2, 1, 2};
11  qp_int Pjc[4] = {0, 2, 5, 7};
12 
13  /* Cost Function c vector */
14  qp_real c[3] = {1.0, 2.0, 1.0};
15 
16  /* Equality Constraint A Matrix in CCS format */
17  qp_real Apr[3] = {1.0, -2.0, 1.0};
18  qp_int Air[3] = {0, 0, 0};
19  qp_int Ajc[4] = {0, 1, 2, 3};
20 
21  /* Equality Constraints b vector */
22  qp_real b[1] = {3.0};
23 
24  /* Inequality Constraint G Matrix in CCS format */
25  qp_real Gpr[3] = {-4.0, -4.0, -1.0};
26  qp_int Gir[3] = {0, 0, 1};
27  qp_int Gjc[4] = {0, 1, 2, 3};
28 
29  /* Inequality Constraint h vector */
30  qp_real h[2] = {-1.0, -1.0};
31 
32  /* Data for QP*/
33  qp_int n = 3; /* Number of decision Variables */
34  qp_int m = 2; /* Number of inequality constraints */
35  qp_int p = 1; /* Number of equality constraints */
36 
37  /* Permutation Vector optional */
38  qp_int Permut[6] = {5, 2, 3, 1, 4, 0};
39 
40  qp_int Permutineq[5] = {4, 2, 0, 3, 1};
41 
42 #endif
43