Revision 304 trunk/contrib/statslib/vcubicspline.cpp

vcubicspline.cpp (revision 304)
78 78
   ptr=0;
79 79
 }
80 80

  
81

  
82

  
83

  
84
/** 
85
	\author Steven James Dean Martell
86
	\date 2011-06-21
87
	\brief A Wrapper for the vcubic_spline_function
88
	\param  spline_nodes a vector of spline knots
89
	\param  ip is a vector of interpreted points
90
	\return returns a vector of interpreted points 
91
	\sa
92
**/
93
dvar_vector cubic_spline(const dvar_vector& spline_nodes, const dvector& ip)
94
{
95
	RETURN_ARRAYS_INCREMENT();                                                              
96
	int nodes=size_count(spline_nodes);
97
	dvector ia(1,nodes);
98
	ia.fill_seqadd(0,1./(nodes-1));
99
	dvector fa = (ip-min(ip))/(max(ip)-min(ip));
100
	vcubic_spline_function ffa(ia,spline_nodes);
101
	RETURN_ARRAYS_DECREMENT();
102
	return(ffa(fa));
103
}
104

  
105

  
106

  
81 107
void bicubic_spline(const dvector& x, const dvector& y, dvar_matrix& knots, dvar_matrix& S)
82 108
{
83 109
		/*

Also available in: Unified diff