a small bug


kuelite
12-01-2007, 02:44 AM
in interp_curve.h
in the line if (s[i] == s[i-1]) throw("error in Curve_interp");

the expression s[i] == s[i-1] is not right for double data type

and i think interp_curve.h is wrong for the following case:

for given x[i] ,y[i] data points, x[i] are not increasing nor decreasing,
for example, x[0]<x[1]<x[2], and x[2]>x[3], and x[3]<x[4]

so using the spline codes including interp_curve.h the results are not Correct.
How to construct spline fuction to deal with the problem?