DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28019>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28019

SplineInterpolator gives bad interpolation

           Summary: SplineInterpolator gives bad interpolation
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Math
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The CubicSplineFunction does not fit on each interval:

> Replace
>             double dquot = (yval[1] - yval[0]) / (xval[1] - xval[0]);
>             for (int i = 0; i < n - 1; i++) {
>                               double dquotNext =
>                                      (yval[i + 2] - yval[i + 1]) / (xval[i
> + 2] - xval[i + 1]);
>                             b[i] = 6.0 * (dquotNext - dquot);
>                             d[i] = 2.0 * (xval[i + 2] - xval[i]);
>                             dquot = dquotNext;
>                   }
> 
> 
> With
> 
>             //Source: http://mathworld.wolfram.com/CubicSpline.html
>             for (int i = 0; i < n - 1; i++) {
>                   b[i] = 3.0 * (yval[i+1] - yval[i]);
>                   d[i] = (i>0 && i<n-2)? 4.0: 2.0 ;
>             }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to