#include <kv/ode-maffine.hpp>
#include <kv/strobomap.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) + 1;
		y(1) = x(0) - 1;

		return y;
	}
};

int main()
{
	ub::vector<itv> ix;
	itv end;
	std::cout.precision(17);

	Func f;

	// use odelong_maffine

	ix.resize(2);
	ix(0) = 0;
	ix(1) = 0;
	end = 1.;
	kv::odelong_maffine(f, ix, (itv)0., end);
	std::cout << ix << "\n";

	// use Strobomap

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

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

	std::cout << g(ix) << "\n";
}
