#include <iostream>
#include <kv/ode-maffine.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); 
		return y;
	}
};

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

	std::cout.precision(17);

	x.resize(2);
	x(0) = 0.;
	x(1) = 1.;

	end = 10000.;

	// r = kv::odelong_maffine(Func(), x, itv(0.), end);

	r = kv::odelong_maffine(Func(), x, itv(0.), end, kv::ode_param<double>().set_ep_reduce(250).set_ep_reduce_limit(300));

	std::cout << x << "\n";
}
