integrale.h 1.99 KB
#ifndef _INTEGRALE_
#define _INTEGRALE_
#include <ibex.h>
#include <vector>
#include "zero.h"
#include "integrale_sol.h"

// #define __DEBUG__



#define __PREC__ (1e-5)
#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;
//     ibex::Variable * _x_var;
    
    std::list<zero*> * _zeros_inf;
    std::list<zero*> * _zeros_sup;
    
    std::pair<integrale_sol, integrale_sol> * _result;
    
    std::list<zero*> * construct_zeros_intern(const ibex::Interval & inf_bound);
    
    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);
    
public:
    //CONSTRUCTORS
    integrale(const ibex::Interval& inf, const ibex::Interval& sup, ibex::Function * f);
    ~integrale();
    
    //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;};
//     inline ibex::Variable * get_x_var() const {return _x_var;};
    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;};
    
    unsigned int construct_zeros_inf();
    
    unsigned int construct_zeros_sup();
    
    unsigned int construct_zeros();
    
    std::pair<integrale_sol, integrale_sol> compute_integral();
};


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

#endif //_INTEGRALE_