main.cpp 735 Bytes
Newer Older
Olivier Mullier's avatar
Olivier Mullier committed
1
2
3
4
5
6
7
8
9
10
#include <ibex.h>
#include "integrale.h"

using namespace std;



void example(){
    cout << setprecision(15);
    ibex::Variable x(1);
Olivier Mullier's avatar
Olivier Mullier committed
11
    ibex::Function f(x, -15. + x+5.*ibex::sin(x));
Olivier Mullier's avatar
Olivier Mullier committed
12
13
14
    ibex::Interval inf(0., 5.5);
    ibex::Interval sup(10, 15.);
    
Olivier Mullier's avatar
Olivier Mullier committed
15
    integrale example(inf, sup, &f);
Olivier Mullier's avatar
Olivier Mullier committed
16
17
18
    
    cout << example << endl;
    example.construct_zeros();
Olivier Mullier's avatar
Olivier Mullier committed
19
    for (auto elem : *example.get_zeros_sup()){
Olivier Mullier's avatar
Olivier Mullier committed
20
        cout << elem << endl;
Olivier Mullier's avatar
Olivier Mullier committed
21
        cout << *elem << endl << endl;
Olivier Mullier's avatar
Olivier Mullier committed
22
    }
Olivier Mullier's avatar
Olivier Mullier committed
23
24
25
26
    example.compute_integral();
    cout << "minimum: " << example.get_result()->first << endl;
    cout << "maximum: " << example.get_result()->second << endl;
    
Olivier Mullier's avatar
Olivier Mullier committed
27
28
29
30
31
32
33
}


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