#include <kv/strobomap.hpp>
#include <kv/kraw-approx.hpp>

namespace ub = boost::numeric::ublas;

typedef kv::interval<double> itv;


struct Func {
	template <class T> ub::vector<T> operator() (const ub::vector<T>& x, T t){
		ub::vector<T> y(2);

		y(0) = x(1);
		y(1) = - x(0)*x(0)*x(0) - 3.;

		return y;
	}
};

int main()
{
	ub::vector<double> x;
	ub::vector<itv> ix;
	int r;

	std::cout.precision(17);

	Func f;

	kv::StroboMap<Func,double> g(f, (itv)0., (itv)1.);

	kv::Shooting_TPBVP< kv::StroboMap<Func,double>, double> h(g, 0., 0., 0, 0);

	x.resize(1);
	x(0) = 1.5; 
	r = kv::krawczyk_approx(h, x, ix, 3);
	if (r) std::cout << ix << "\n";
}
