IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2005, 4:47:16 PM (21 years ago)
Author:
gusciora
Message:

The nX terms for the polynomials now refer to the order, not the number
of terms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psSpline.c

    r5072 r5090  
    77*  splines.
    88*
    9 *  @version $Revision: 1.126 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-09-20 02:43:53 $
     9*  @version $Revision: 1.127 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-09-22 02:47:16 $
    1111*
    1212*
     
    383383    // If these are linear splines, which means their polynomials will have
    384384    // two coefficients, then we do the simple calculation.
    385     if (2 == (spline->spline[0])->n) {
     385    if (1 == (spline->spline[0])->COOL_1D_n) {
    386386        for (i=0;i<spline->n;i++) {
    387387            slope = (y32->data.F32[i+1] - y32->data.F32[i]) /
     
    402402
    403403    // Check if these are cubic splines (n==4).  If not, psError.
    404     if (4 != (spline->spline[0])->n) {
     404    if (3 != (spline->spline[0])->COOL_1D_n) {
    405405        psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    406406                "Don't know how to generate %u-order splines.",
    407                 (spline->spline[0])->n-1);
     407                (spline->spline[0])->COOL_1D_n);
    408408        return(NULL);
    409409    }
     
    745745    tmpSpline->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *));
    746746    for (unsigned int i=0;i<numSplines;i++) {
    747         (tmpSpline->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);
     747        (tmpSpline->spline)[i] = psPolynomial1DAlloc(order, PS_POLYNOMIAL_ORD);
    748748    }
    749749
     
    809809    tmpSpline->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *));
    810810    for (unsigned int i=0;i<numSplines;i++) {
    811         (tmpSpline->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);
     811        (tmpSpline->spline)[i] = psPolynomial1DAlloc(order, PS_POLYNOMIAL_ORD);
    812812    }
    813813
Note: See TracChangeset for help on using the changeset viewer.