IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2741


Ignore:
Timestamp:
Dec 16, 2004, 2:18:31 PM (22 years ago)
Author:
gusciora
Message:

Fixed chebyshev polynomial code.

Location:
trunk/psLib/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psConstants.h

    r2739 r2741  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-12-16 23:04:17 $
     8 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-12-17 00:18:31 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999            #NAME1, #NAME2); \
    100100    return(RVAL); \
     101}
     102
     103#define PS_FLOAT_CHECK_RANGE(NAME, LOWER, UPPER, RVAL) \
     104if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
     105    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
     106            "Error: %s, %f, is out of range.  Must be between %f and %f.", \
     107            #NAME, NAME, LOWER, UPPER); \
     108    return RVAL; \
    101109}
    102110
  • trunk/psLib/src/dataManip/psFunctions.c

    r2716 r2741  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-12-15 23:35:34 $
     9 *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-12-17 00:18:31 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    306306// XXX: You can do this without having to psAlloc() vector d.
    307307// XXX: How does the mask vector effect Crenshaw's formula?
     308// XXX: We assume that x is scaled between -1.0 and 1.0;
    308309static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
    309310{
     311    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     312    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
    310313    psVector *d;
    311314    psS32 n;
  • trunk/psLib/src/dataManip/psMinimize.c

    r2739 r2741  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-12-16 23:04:17 $
     11 *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-12-17 00:18:31 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    10491049        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
    10501050        PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static);
     1051        if (myPoly->type == PS_POLYNOMIAL_CHEB) {
     1052            p_psNormalizeVectorRangeF64(x64, -1.0, 1.0);
     1053        }
    10511054    }
    10521055    PS_VECTOR_CHECK_SIZE_EQUAL(x64, y64, NULL);
  • trunk/psLib/src/math/psConstants.h

    r2739 r2741  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-12-16 23:04:17 $
     8 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-12-17 00:18:31 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999            #NAME1, #NAME2); \
    100100    return(RVAL); \
     101}
     102
     103#define PS_FLOAT_CHECK_RANGE(NAME, LOWER, UPPER, RVAL) \
     104if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \
     105    psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
     106            "Error: %s, %f, is out of range.  Must be between %f and %f.", \
     107            #NAME, NAME, LOWER, UPPER); \
     108    return RVAL; \
    101109}
    102110
  • trunk/psLib/src/math/psMinimize.c

    r2739 r2741  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-12-16 23:04:17 $
     11 *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-12-17 00:18:31 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    10491049        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
    10501050        PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static);
     1051        if (myPoly->type == PS_POLYNOMIAL_CHEB) {
     1052            p_psNormalizeVectorRangeF64(x64, -1.0, 1.0);
     1053        }
    10511054    }
    10521055    PS_VECTOR_CHECK_SIZE_EQUAL(x64, y64, NULL);
  • trunk/psLib/src/math/psPolynomial.c

    r2716 r2741  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-12-15 23:35:34 $
     9 *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-12-17 00:18:31 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    306306// XXX: You can do this without having to psAlloc() vector d.
    307307// XXX: How does the mask vector effect Crenshaw's formula?
     308// XXX: We assume that x is scaled between -1.0 and 1.0;
    308309static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
    309310{
     311    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     312    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
    310313    psVector *d;
    311314    psS32 n;
  • trunk/psLib/src/math/psSpline.c

    r2716 r2741  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-12-15 23:35:34 $
     9 *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-12-17 00:18:31 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    306306// XXX: You can do this without having to psAlloc() vector d.
    307307// XXX: How does the mask vector effect Crenshaw's formula?
     308// XXX: We assume that x is scaled between -1.0 and 1.0;
    308309static float chebPolynomial1DEval(float x, const psPolynomial1D* myPoly)
    309310{
     311    //    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
     312    PS_FLOAT_CHECK_RANGE(x, -1.0, 1.0, 0.0);
    310313    psVector *d;
    311314    psS32 n;
Note: See TracChangeset for help on using the changeset viewer.