/* cspl.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ #include #include void cspl(double *x,double *y,double *z,int m,double tn) { double h,s,t,*pa,*pb,*a,*b; int j; if(tn==0.) tn=2.; else{ h=sinh(tn); tn=(tn*cosh(tn)-h)/(h-tn);} pa=(double *)calloc(2*m,sizeof(double)); pb=pa+m; h=x[1]-x[0]; t=(y[1]-y[0])/h; for(j=1,a=pa,b=pb; j0 ;--j){ z[j]-= *b-- *z[j+1]; z[j]/= *a--;} free(pa); }