de_rwth_monticar_optimization_quadraticOpt.h 2.12 KB
Newer Older
Jan Philipp Haller's avatar
Jan Philipp Haller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef DE_RWTH_MONTICAR_OPTIMIZATION_QUADRATICOPT
#define DE_RWTH_MONTICAR_OPTIMIZATION_QUADRATICOPT
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "armadillo"
#include "CallIpopt1091.h"
using namespace arma;
class de_rwth_monticar_optimization_quadraticOpt{
public:
mat CONSTANTCONSTANTVECTOR0;
mat CONSTANTCONSTANTVECTOR1;
mat CONSTANTCONSTANTVECTOR2;
colvec CONSTANTCONSTANTVECTOR3;
colvec CONSTANTCONSTANTVECTOR4;
colvec CONSTANTCONSTANTVECTOR5;
void init()
{
CONSTANTCONSTANTVECTOR0 = mat(3,3);
CONSTANTCONSTANTVECTOR0(0,0) = 1;
CONSTANTCONSTANTVECTOR0(0,1) = 0;
CONSTANTCONSTANTVECTOR0(0,2) = 0;
CONSTANTCONSTANTVECTOR0(1,0) = 0;
CONSTANTCONSTANTVECTOR0(1,1) = 2;
CONSTANTCONSTANTVECTOR0(1,2) = 0;
CONSTANTCONSTANTVECTOR0(2,0) = 0;
CONSTANTCONSTANTVECTOR0(2,1) = 0;
CONSTANTCONSTANTVECTOR0(2,2) = 3;
CONSTANTCONSTANTVECTOR1 = mat(3,2);
CONSTANTCONSTANTVECTOR1(0,0) = 1;
CONSTANTCONSTANTVECTOR1(0,1) = 1;
CONSTANTCONSTANTVECTOR1(1,0) = 2;
CONSTANTCONSTANTVECTOR1(1,1) = 2;
CONSTANTCONSTANTVECTOR1(2,0) = 3;
CONSTANTCONSTANTVECTOR1(2,1) = 3;
36
CONSTANTCONSTANTVECTOR2 = mat(3,2);
Jan Philipp Haller's avatar
Jan Philipp Haller committed
37
38
39
CONSTANTCONSTANTVECTOR2(0,0) = 2;
CONSTANTCONSTANTVECTOR2(0,1) = 2;
CONSTANTCONSTANTVECTOR2(1,0) = 3;
40
41
42
CONSTANTCONSTANTVECTOR2(1,1) = 3;
CONSTANTCONSTANTVECTOR2(2,0) = 4;
CONSTANTCONSTANTVECTOR2(2,1) = 4;
Jan Philipp Haller's avatar
Jan Philipp Haller committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
CONSTANTCONSTANTVECTOR3 = colvec(3);
CONSTANTCONSTANTVECTOR3(0,0) = 4;
CONSTANTCONSTANTVECTOR3(1,0) = 5;
CONSTANTCONSTANTVECTOR3(2,0) = 6;
CONSTANTCONSTANTVECTOR4 = colvec(2);
CONSTANTCONSTANTVECTOR4(0,0) = 3;
CONSTANTCONSTANTVECTOR4(1,0) = 3;
CONSTANTCONSTANTVECTOR5 = colvec(2);
CONSTANTCONSTANTVECTOR5(0,0) = 6;
CONSTANTCONSTANTVECTOR5(1,0) = 5;
}
void execute()
{
mat A = CONSTANTCONSTANTVECTOR0;
mat B = CONSTANTCONSTANTVECTOR1;
mat C = CONSTANTCONSTANTVECTOR2;
colvec c = CONSTANTCONSTANTVECTOR3;
double d = 42;
colvec f = CONSTANTCONSTANTVECTOR4;
colvec h = CONSTANTCONSTANTVECTOR5;
colvec x=colvec(3);
double val;
CallIpopt1091::solveOptimizationProblemIpOpt(&x, &val, A, B, C, c, d, f, h, CONSTANTCONSTANTVECTOR0, CONSTANTCONSTANTVECTOR1, CONSTANTCONSTANTVECTOR2, CONSTANTCONSTANTVECTOR3, CONSTANTCONSTANTVECTOR4, CONSTANTCONSTANTVECTOR5);
}

};
#endif