integralii.h 1.81 KB
/*
 * <one line to give the library's name and an idea of what it does.>
 * Copyright (C) 2019  mullier <email>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef INTEGRALII_H
#define INTEGRALII_H

#include <ibex.h>
#include "integralrr.h"

/**
 * @todo write docs
 */
class IntegralII
{
private:
    ibex::Interval _inf_endpoint;
    ibex::Interval _sup_endpoint;
    
    ibex::Function * _f;
    
    std::pair<IntegralRR, IntegralRR> _solution;
    
    std::list<ibex::Interval*>& compute_list_of_zeros(ibex::Interval searchdomain);
    
public:
    IntegralII(const ibex::Interval & inf, const ibex::Interval & sup, ibex::Function * f) : _inf_endpoint(inf), _sup_endpoint(sup), _f(f){};
    
    ibex::Interval get_inf_endpoint() const {return _inf_endpoint;};
    ibex::Interval get_sup_endpoint() const {return _sup_endpoint;};
    
    ibex::Function * get_f() const {return _f;};
    
    std::pair<IntegralRR, IntegralRR> get_solution() const {return _solution;};

    std::list<ibex::Interval*>& compute_list_of_zeros_inf();
    
    std::list<ibex::Interval*>& compute_list_of_zeros_sup();    
    
    void compute_integral();
    
};

std::ostream& operator<<(std::ostream& os, const IntegralII& integral);

#endif // INTEGRALEII_H