/*<html><pre>*/
#ifndef V_GPSP_H
#define V_GPSP_H

/*
 *	General-purpose one-dimensional spline interpolation functions.
 */

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/*
	 * One-dimensional spline interpolator object
	 */
	void_p	V_GLOBAL	cspCreate(vector_t *vx,vector_t *vy);
	void_p	V_GLOBAL	cspVecCreate(vec_p X,vec_p Y,u32_t num_points);
	vec_t	V_GLOBAL	cspInterpolate(void_p handle,vec_t x);
	void	V_GLOBAL	cspChangeX(void_p handle,vector_t *new_x);
	void	V_GLOBAL	cspChangeY(void_p handle,vector_t *new_y);
	/*
	 * If zero_second_derivative == false, 1st derivs will be used */
	void	V_GLOBAL	cspSetBoundaryCondition(void_p handle,
		vboolean zero_second_derivative,vec_t f_deriv_l,vec_t f_deriv_r);
	void	V_GLOBAL	cspDestroy(void_p handle);
	/*
	 * Multi-dimensional spline interpolator object.
	 * - ndim: dimension of input space;
	 * - vt: vector of parameter values (of arbitrary size N; N assumed to be >= 2);
	 * - vx: array[0..ndim-1] of vectors [0..N-1] of variables.
	 * 
	 * Note.
	 * If first point (vx[0]->elements[0],vx[1]->elements[0],...,vx[ndim-1]->elements[0])
	 * and last point (vx[0]->elements[N],vx[1]->elements[N],...,vx[ndim-1]->elements[N])
	 * are the same, boundary condition will be changed to 'periodic'
	 * (see v_spline.c for dirty implementation details).
	 */
	vhandle_t	V_GLOBAL	cspNdCreate(vector_t *vt,vector_t *vx[],u32_t ndim);
	void 		V_GLOBAL	cspNdInterpolate(vhandle_t handle,vec_t t,vec_t *xa_ret);
	void    	V_GLOBAL	cspNdChangeX(vhandle_t handle,vector_t *new_x[]);
	void		V_GLOBAL	cspNdDestroy(vhandle_t handle);

#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_GPSP_H */
/*</pre></strong></body></html>*/
/*EOF*/
