#ifndef V_RKEMBD_H
#define	V_RKEMBD_H

typedef vboolean (V_CALL *ode_monitor_t)(void *param,vec_t x,vec_t y[]);

/*
 * The default value of the maximal time consumed by ODE solver od 5 s
 */
#define	ODE_TIMEOUT			1
#define	ODE_MAXIMAL_STEP	2

#ifdef  __cplusplus
extern  "C" {
#endif  /* __cplusplus */
	/*
	 * Embedded Runge-Kutta ODE solver from NR
	 */
	/* fixme: to be changed */
	vhandle_t V_GLOBAL  odeCreateSolver(
		u32_t num_variables, /* number of dependant variables */
	/* fixme: to be changed: should return 'false' to reject step */
		void (V_CALL *derivs)(void_p rh_arg,vec_t dest_dxdy[],vec_t x,vec_t y[]), /* right side */
		vboolean verbose);
	/* fixme: to be changed */
	void V_GLOBAL   odeSetMonitor(vhandle_t handle, /* solver */
		ode_monitor_t monitor, /* callback routine */
		void *param, /* value for 1st argument of the callback routine */
		vec_t delta_x, /* save interval */
		vboolean exact); /* set to true to force solver to hit save points exactly */
	/* fixme: to be changed */
	vboolean V_GLOBAL   odeIntegrate(vhandle_t handle, /* solver */
		vec_t ystart[], /* initial conditions at point x1 */
		vec_t x1,vec_t x2, /* interval of the integration */
		vec_t eps, /* tolerance */
		vec_t h1, /* initial step size */
		vec_t hmin, /* minimal step size */
		void_p rh_arg); /* first argument for 'derivs' routine */
	/* The next routine can be called from 'derivs' to force step minification */
	void    V_GLOBAL    odeRejectStep(vhandle_t handle);
	/* The next routine can be called from 'derivs' to terminate integration */
	void    V_GLOBAL    odeTerminateIntegration(vhandle_t handle);
	/* Destructor */
	void    V_GLOBAL    odeDestroySolver(vhandle_t handle);
	vboolean	V_GLOBAL	odeSetReal(vhandle_t handle,u32_t pname,vec_t param);
/*
	vboolean	V_GLOBAL	odeGetReal(vhandle_t handle,u32_t pname,vec_t param);
*/

#ifdef  __cplusplus
}
#endif  /* __cplusplus */

#endif	/* !V_RKEMBD_H */

