#ifndef ODESOLVER_H
#define ODESOLVER_H

#include "vl/VLd.h"
#include <utility>

class OdeFunc1
{
public:
    virtual Vecd		operator()(const Vecd &x) const = 0;
    virtual SparseMatd	dx(const Vecd &x) const = 0;
    
    virtual ~OdeFunc1() {}
};

// Solves x' = f(x), f is OdeFunc1 obj
class OdeSolver1
{
public:
    virtual void step(Vecd &xout, const OdeFunc1 &f, const Vecd &x, double h) const = 0;
    virtual ~OdeSolver1() {}
};


class OdeFunc2
{
public:
    virtual Vecd        operator()(const Vecd &x, const Vecd &v) const = 0;
    virtual SparseMatd  dx(const Vecd &x, const Vecd &v) const = 0;
    virtual SparseMatd  dv(const Vecd &x, const Vecd &v) const = 0;

    virtual ~OdeFunc2() {}
};


// Solves x'' = f(x,v)
class OdeSolver2
{
public:
    virtual void step(Vecd &xout, Vecd &vout,
        const OdeFunc2 &f, const Vecd &x, const Vecd &v, double h) const = 0;

    virtual ~OdeSolver2() {}   
};



#endif
