-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExample1.cpp
60 lines (43 loc) · 1.27 KB
/
Example1.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <cstdlib>
#include <ibex/ibex.h>
#include "CtcBoxLMI.h"
using namespace std;
using namespace ibex;
void sivia(const IntervalVector &search, BoolInterval(*inclusionTest)(IntervalVector), const double &EPSILON, string &vibesFigName);
int main()
{
cout << "Main" << endl;
MatrixArray mA(3, 2, 2);
Matrix m0 = Matrix::zeros(2);
Matrix m1(2, 2);
m1 = Matrix::zeros(2);
m1[0][0] = 1;
m1[0][1] = 1;
m1[1][0] = 1;
Matrix m2(2, 2);
m2 = Matrix::zeros(2);
m2[0][1] = 1;
m2[1][0] = 1;
m2[1][1] = 1;
mA[0] = m0;
mA[1] = m1;
mA[2] = m2;
CtcBoxLMI cBox(mA);
cout << "cBox" << endl;
IntervalVector iV(2, Interval(-1000, 1000));
cBox.contract(iV);
cout << "iV: " << iV << endl;
NumConstraint c1("x1", "x2", "(x1+x2+sqrt((x1-x2)^2+4*(x1+x2)^2))/2>=0");
NumConstraint c2("x1", "x2", "(x1+x2-sqrt((x1-x2)^2+4*(x1+x2)^2))/2>=0");
CtcFwdBwd ct1(c1);
CtcFwdBwd ct2(c2);
CtcCompo ctComp(ct1, ct2);
iV = IntervalVector(2, Interval(8, 10));
ctComp.contract(iV);
cout << "ctComp(box): " << iV << endl;
return EXIT_SUCCESS;
}
void sivia(const IntervalVector &search, BoolInterval(*inclusionTest)(IntervalVector), const double &EPSILON, string &vibesFigName)
{
// list
}