IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2004, 12:27:06 PM (22 years ago)
Author:
gusciora
Message:

Added F64 version of spline eval tests.

File:
1 edited

Legend:

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

    r1982 r1985  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-10-06 21:30:53 $
     9 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-10-06 22:27:06 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    20652065 
    20662066XXX: SDR is silent about data types.  PS_TYPE_F32 is implemented.
     2067 
     2068XXX: The spline eval functions require input and output to be F32.  however
     2069     the spline fit functions require F32 and F64.
    20672070 *****************************************************************************/
    20682071float psSpline1DEval(const psSpline1D *spline,
     
    20902093}
    20912094
     2095// XXX: The spline eval functions require input and output to be F32.
     2096// however the spline fit functions require F32 and F64.
    20922097psVector *psSpline1DEvalVector(const psVector *x,
    20932098                               const psSpline1D *spline)
     
    20972102
    20982103    tmpVector = psVectorAlloc(x->n, PS_TYPE_F32);
    2099     for (i=0;i<x->n;i++) {
    2100         tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]);
     2104    if (x->type.type == PS_TYPE_F32) {
     2105        for (i=0;i<x->n;i++) {
     2106            tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]);
     2107        }
     2108    } else if (x->type.type == PS_TYPE_F64) {
     2109        for (i=0;i<x->n;i++) {
     2110            tmpVector->data.F32[i] = psSpline1DEval(spline, (float) x->data.F64[i]);
     2111        }
     2112    } else {
     2113        psError(__func__, "Unknown data type.\n");
     2114        return(NULL);
    21012115    }
    21022116
Note: See TracChangeset for help on using the changeset viewer.