IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2005, 10:41:04 AM (21 years ago)
Author:
gusciora
Message:

Substituted knots for domains in the spline structs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMinimize.c

    r3027 r3096  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.101 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-17 23:25:09 $
     11 *  @version $Revision: 1.102 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-26 20:41:04 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    171171    PS_PTR_CHECK_NULL(spline, NAN);
    172172    PS_INT_CHECK_NON_NEGATIVE(spline->n, NAN);
    173     PS_PTR_CHECK_NULL(spline->domains, NAN);
     173    PS_VECTOR_CHECK_NULL(spline->domains, NAN);
    174174    PS_PTR_CHECK_NULL(spline->p_psDeriv2, NAN);
    175175    PS_VECTOR_CHECK_NULL(x, NAN);
     
    189189 
    190190    n = spline->n;
    191     klo = p_psVectorBinDisect32(spline->domains, (spline->n)+1, X);
     191    klo = p_psVectorBinDisect32(spline->knots->data.F32, (spline->n)+1, X);
    192192    if (klo < 0) {
    193193        psLogMsg(__func__, PS_LOG_WARN,
     
    196196    }
    197197    khi = klo + 1;
    198     H = (spline->domains)[khi] - (spline->domains)[klo];
    199     A = ((spline->domains)[khi] - X) / H;
    200     B = (X - (spline->domains)[klo]) / H;
     198    H = spline->knots->data.F32[khi] - spline->knots->data.F32[klo];
     199    A = (spline->knots->data.F32[khi] - X) / H;
     200    B = (X - spline->knots->data.F32[klo]) / H;
    201201    C = ((A*A*A)-A) * (H*H/6.0);
    202202    D = ((B*B*B)-B) * (H*H/6.0);
     
    236236 
    237237XXX: Is the x argument redundant?  What do we do if the x argument is
    238 supplied, but does not equal the domains specified in mySpline?
     238supplied, but does not equal the knots specified in mySpline?
    239239 
    240240XXX: can psSpline be NULL?
     
    314314        for (i=0;i<mySpline->n;i++) {
    315315            slope = (y32->data.F32[i+1] - y32->data.F32[i]) /
    316                     (mySpline->domains[i+1] - mySpline->domains[i]);
     316                    (mySpline->knots->data.F32[i+1] - mySpline->knots->data.F32[i]);
    317317            (mySpline->spline[i])->coeff[0] = y32->data.F32[i] -
    318                                               (slope * mySpline->domains[i]);
     318                                              (slope * mySpline->knots->data.F32[i]);
    319319
    320320            (mySpline->spline[i])->coeff[1] = slope;
Note: See TracChangeset for help on using the changeset viewer.