Hello,
Very many thanks for your response. I do apologize for my first post, since there was also two points with the same X coordination in my synthetic dataset. Therefore, I thought that the error was related to the sorting problem. When I deleted one of them, everythings went right. Thank you again for you answer and at the same time for this great library.
For my second Question, the problem was solved. Since I have a dataset looking like a semi-circle, I converted the explicit equation to a paramteric one. Consequently-->
t = number of samples double[] x = x-coordinate of samples double[] y = y-coordinate of samples
Since I want to caculate a appoximate first derivative along the curve, I have followed this approach ():
double[] T = {1,2,....,t}; alglib.spline1dgriddiffcubic(T, x, t, 0, 0.0, 0, 0.0, out Dx); alglib.spline1dgriddiffcubic(T, y, t, 0, 0.0, 0, 0.0, out Dy);
and finally the first derivative is calculated as follows:
D = Dy / Dx; for each of elements
I think it would an advantegous for AlgLib if these procedures (for all spline interpolation methods) become available in the package.
Siamak
|