PSOPT / psopt

PSOPT Optimal Control Software
GNU Lesser General Public License v2.1
193 stars 75 forks source link

smooth_linear_interpolation funciton in interpolation.cxx #8

Closed ricwtk closed 5 years ago

ricwtk commented 7 years ago

I noticed that the two smooth_linear_interpolation functions defined in the interpolation.cxx file are slightly different. In the second declaration of the smooth_linear_interpolation: smooth_linear_interpolation(adouble* y, adouble& x, adouble* Xdata, adouble* Ydata, int n), the following lines are commented:

//  Si = smooth_heaviside( (x-(Xdata[0]-100*a)), a ) - smooth_heaviside( (x-Xdata[0]), a );
//  *y+=Si*Ydata[0];
//  Si = smooth_heaviside( (x-Xdata[n-1]), a ) - smooth_heaviside( (x-(Xdata[n-1]+100*a)), a );
//  *y+=Si*Ydata[n-1];

whereas these lines are not commented in the first declaration of the smooth_linear_interpolation (smooth_linear_interpolation(adouble* y, adouble& x, DMatrix& Xdata, DMatrix& Ydata, int n))

Which one is the intended one?