integrale.h 1.99 KB
Newer Older
Olivier Mullier's avatar
Olivier Mullier committed
1
2
3
4
5
6
7
8
9
10
11
#ifndef _INTEGRALE_
#define _INTEGRALE_
#include <ibex.h>
#include <vector>
#include "zero.h"
#include "integrale_sol.h"

// #define __DEBUG__



Olivier Mullier's avatar
Olivier Mullier committed
12
#define __PREC__ (1e-5)
Olivier Mullier's avatar
Olivier Mullier committed
13
14
15
16
17
18
19
20
21
22
23
24
#define __EPS__ (1e-1)
#define __SHOW_FCT_NAME__   {std::cout << __func__ << std::endl;}



class integrale{
private:
    
    ibex::Interval _inf_bound;
    ibex::Interval _sup_bound;
    
    ibex::Function * _f;
Olivier Mullier's avatar
Olivier Mullier committed
25
//     ibex::Variable * _x_var;
Olivier Mullier's avatar
Olivier Mullier committed
26
    
Olivier Mullier's avatar
Olivier Mullier committed
27
28
    std::list<zero*> * _zeros_inf;
    std::list<zero*> * _zeros_sup;
Olivier Mullier's avatar
Olivier Mullier committed
29
    
Olivier Mullier's avatar
Olivier Mullier committed
30
    std::pair<integrale_sol, integrale_sol> * _result;
Olivier Mullier's avatar
Olivier Mullier committed
31
    
Olivier Mullier's avatar
Olivier Mullier committed
32
    std::list<zero*> * construct_zeros_intern(const ibex::Interval & inf_bound);
Olivier Mullier's avatar
Olivier Mullier committed
33
    
Olivier Mullier's avatar
Olivier Mullier committed
34
35
36
37
38
39
40
41
42
    integrale_sol compute_integral(zero* inf, zero* sup);
    
    std::list<ibex::Interval> compute_integral(const double & inf_bound, const ibex::Interval & sup_bound);
    
    ibex::Interval compute_integral(const double inf_bound, const double sup_bound);
    
    std::pair<integrale_sol, integrale_sol> compute_integral_inf(const ibex::Interval & range);
    
    std::pair<integrale_sol, integrale_sol> compute_integral_sup(const ibex::Interval & range);
Olivier Mullier's avatar
Olivier Mullier committed
43
44
45
    
public:
    //CONSTRUCTORS
Olivier Mullier's avatar
Olivier Mullier committed
46
47
    integrale(const ibex::Interval& inf, const ibex::Interval& sup, ibex::Function * f);
    ~integrale();
Olivier Mullier's avatar
Olivier Mullier committed
48
49
50
51
52
    
    //GETTERS
    inline ibex::Interval get_inf_bound() const {return _inf_bound;};
    inline ibex::Interval get_sup_bound() const {return _sup_bound;};
    inline ibex::Function * get_f() const {return _f;};
Olivier Mullier's avatar
Olivier Mullier committed
53
//     inline ibex::Variable * get_x_var() const {return _x_var;};
Olivier Mullier's avatar
Olivier Mullier committed
54
55
56
    inline std::list<zero*> * get_zeros_inf(){return _zeros_inf;};
    inline std::list<zero*> * get_zeros_sup(){return _zeros_sup;};
    inline std::pair<integrale_sol, integrale_sol> * get_result(){return _result;};
Olivier Mullier's avatar
Olivier Mullier committed
57
58
59
60
61
62
63
    
    unsigned int construct_zeros_inf();
    
    unsigned int construct_zeros_sup();
    
    unsigned int construct_zeros();
    
Olivier Mullier's avatar
Olivier Mullier committed
64
    std::pair<integrale_sol, integrale_sol> compute_integral();
Olivier Mullier's avatar
Olivier Mullier committed
65
66
67
68
69
70
};


std::ostream& operator<<(std::ostream& os, const integrale& inte);

#endif //_INTEGRALE_