main.cpp 1.04 KB
Newer Older
Olivier Mullier's avatar
Olivier Mullier 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
36
37
38
39
#include <ibex.h>
#include "integrale.h"

using namespace std;



void example(){
    cout << setprecision(15);
    ibex::Variable x(1);
    ibex::Function f(x, ibex::sin(x));
    ibex::Interval inf(0., 5.5);
    ibex::Interval sup(10, 15.);
    
    integrale example(inf, sup, &f, &x);
    
    cout << example << endl;
    
    example.construct_zeros();
//     pair<integrale_sol, integrale_sol> res = example.compute_integral_inf(inf);
//     cout << "minimum: " << res.first << endl;
//     cout << "maximum: " << res.second << endl;
//     for (auto  elem : *(example.get_zeros_inf())){
//         cout << elem << endl;
//     }
    cout << "======================================================" << endl;
    pair<integrale_sol, integrale_sol> res2 = example.compute_integral_sup(sup);
    cout << "minimum: " << res2.first << endl;
    cout << "maximum: " << res2.second << endl;
    for (auto  elem : *(example.get_zeros_sup())){
        cout << elem << endl;
    }
}


int main(/*int argc, char * argv[]*/){
    example();
    return EXIT_SUCCESS;
}