#ifndef SIVIA_H
#define SIVIA_H

#include "frame.h"
#include "ibex.h"

using namespace ibex;
using namespace std;

class Sivia {
public:

    /*
     * Run the SIVIA algorithm.
     *
     * Parameters:
     * frame:   where to draw the boxes.
     * epsilon: precision downto which boxes are bisected.
     */
    Sivia(Frame& frame, double epsilon);

    /* =========================== Question 1 ====================================
     * Check if f(x) is inside y and draw the box if it is the case,
     * with the colors "pencolor" and "brushcolor".
     */
    bool check_and_draw(Function& f, const Interval& y, IntervalVector& x, const QColor & pencolor, const QColor & brushcolor);

    /* =========================== Question 2 ====================================
     * Contract "box" with "c" and draw the trace (i.e., the difference between box and c(box))
     * with the colors "pencolor" and "brushcolor".
     */
    //void contract_and_draw(Ctc& c, IntervalVector& x,  const QColor & pencolor, const QColor & brushcolor);

private:
    Frame& frame;
};

#endif // SIVIA_H
