26 double den,dif,dift,ho,hp,
w;
29 vector <double> c(
n),d(
n);
32 if ((dift = fabs(xx-vx[i]))<dif){
45 if(( den = ho-hp) == 0.0) std::cout<<
"Error in routine polint"<<std::endl;
50 y += (dy=(2*(
ns+1)< (
n-m) ? c[
ns+1]: d[
ns--]));
55 if(value <0) value = 0;
62 const double TINY=1.0e-25;
67 vector <double> c(
n),d(
n);
89 if (dd == 0.0) std::cout<<
"Error in routine ratint"<<std::endl;
94 y += (dy=(2*(
ns+1) < (
n-m) ? c[
ns+1] : d[
ns--]));
98 if(value <0) value = 0;
106 for(
int i=0;i<size;i++){y2.push_back(0.0);}
119 u[0]=(3.0/(vx[1]-vx[0]))*((vy[1]-vy[0])/(vx[1]-vx[0])-yp1);
121 for (i=1;i<
n-1;i++) {
122 sig=(vx[i]-vx[i-1])/(vx[i+1]-vx[i-1]);
124 double yy2=(sig-1.0)/p;
126 u[i]=(vy[i+1]-vy[i])/(vx[i+1]-vx[i]) - (vy[i]-vy[i-1])/(vx[i]-vx[i-1]);
127 u[i]=(6.0*u[i]/(vx[i+1]-vx[i-1])-sig*u[i-1])/p;
133 un=(3.0/(vx[
n-1]-vx[
n-2]))*(ypn-(vy[
n-1]-vy[
n-2])/(vx[
n-1]-vx[
n-2]));
135 y2[
n-1]=(un-qn*u[
n-2])/(qn*y2[
n-2]+1.0);
137 y2[k]=y2[k]*y2[k+1]+u[k];
142 vector <double> y2a =
spline();
150 while (khi-klo > 1) {
152 if (vx[k] > xx) khi=k;
156 if (h == 0.0) std::cout<<
"Bad xa input to routine splint"<<std::endl;
159 y=a*vy[klo]+b*vy[khi]+((a*a*a-a)*y2a[klo]
160 +(b*b*b-b)*y2a[khi])*(h*h)/6.0;
vector< double > spline()