/* interpolate.cpp - use GSL interpolation to interpolate outputdata Copyright (C) 2010 Rui Rodrigues This software is released under the terms of the GNU General Public License (http://www.gnu.org/copyleft/gpl.html). */ #include #include #include #include #include #include using namespace std; void interpolatepatchdata(gsl_matrix*&patchdata,int newpatchsize,int step){ int npatches=patchdata->size1; int patchsize=patchdata->size2; gsl_matrix *newpatchdata=gsl_matrix_alloc(npatches,newpatchsize); double x[patchsize]; for(int k=0, i=0;kdata+i*patchsize; gsl_interp_accel *acc= gsl_interp_accel_alloc (); gsl_spline *spline= gsl_spline_alloc (gsl_interp_cspline, patchsize); gsl_spline_init (spline, x, y, patchsize); for (int j = 0; j