#include#include #include double INTERPOLATE1D( double logx,const vector & logx0, const vector & logy0) { const gsl_interp_type *T = gsl_interp_cspline;//gsl_interp_linear; gsl_spline *s = gsl_spline_alloc(T,logx0.size()); gsl_interp_accel *acc = gsl_interp_accel_alloc(); gsl_spline_init(s,&logx0[0],&logy0[0],logx0.size()); double logy = gsl_spline_eval(s,logx,acc); gsl_spline_free(s); gsl_interp_accel_free(acc); return pow(10,logy); }
Interested in particle astrophysics and plasma astrophysics. This blog is my research/private notebook.
Friday, August 2, 2024
GSL interpolation
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment