IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 21, 2004, 7:09:32 PM (22 years ago)
Author:
gusciora
Message:

Changed types to PS types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psPolynomial.h

    r2600 r2788  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-12-02 21:12:51 $
     14*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-12-22 05:09:32 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3939 *        \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f]
    4040 *
    41  *  @return float      value on the gaussian curve given the input parameters
    42  */
    43 float psGaussian(
    44     float x,                           ///< Value at which to evaluate
    45     float mean,                        ///< Mean for the Gaussian
    46     float stddev,                      ///< Standard deviation for the Gaussian
     41 *  @return psF32      value on the gaussian curve given the input parameters
     42 */
     43psF32 psGaussian(
     44    psF32 x,                           ///< Value at which to evaluate
     45    psF32 mean,                        ///< Mean for the Gaussian
     46    psF32 stddev,                      ///< Standard deviation for the Gaussian
    4747    psBool normal                        ///< Indicates whether result should be normalized
    4848);
     
    5555 */
    5656psVector* p_psGaussianDev(
    57     float mean,                        ///< The mean of the Gaussian
    58     float sigma,                       ///< The sigma of the Gaussian
     57    psF32 mean,                        ///< The mean of the Gaussian
     58    psF32 sigma,                       ///< The sigma of the Gaussian
    5959    psS32 Npts                           ///< The size of the vector
    6060);
     
    7070    psPolynomialType type;             ///< Polynomial type
    7171    psS32 n;                             ///< Number of terms
    72     float *coeff;                      ///< Coefficients
    73     float *coeffErr;                   ///< Error in coefficients
    74     char *mask;                        ///< Coefficient mask
     72    psF32 *coeff;                      ///< Coefficients
     73    psF32 *coeffErr;                   ///< Error in coefficients
     74    psU8 *mask;                        ///< Coefficient mask
    7575}
    7676psPolynomial1D;
     
    8282    psS32 nX;                            ///< Number of terms in x
    8383    psS32 nY;                            ///< Number of terms in y
    84     float **coeff;                     ///< Coefficients
    85     float **coeffErr;                  ///< Error in coefficients
    86     char **mask;                       ///< Coefficients mask
     84    psF32 **coeff;                     ///< Coefficients
     85    psF32 **coeffErr;                  ///< Error in coefficients
     86    psU8 **mask;                       ///< Coefficients mask
    8787}
    8888psPolynomial2D;
     
    9595    psS32 nY;                            ///< Number of terms in y
    9696    psS32 nZ;                            ///< Number of terms in z
    97     float ***coeff;                    ///< Coefficients
    98     float ***coeffErr;                 ///< Error in coefficients
    99     char ***mask;                      ///< Coefficients mask
     97    psF32 ***coeff;                    ///< Coefficients
     98    psF32 ***coeffErr;                 ///< Error in coefficients
     99    psU8 ***mask;                      ///< Coefficients mask
    100100}
    101101psPolynomial3D;
     
    109109    psS32 nY;                            ///< Number of terms in y
    110110    psS32 nZ;                            ///< Number of terms in z
    111     float ****coeff;                   ///< Coefficients
    112     float ****coeffErr;                ///< Error in coefficients
    113     char ****mask;                     ///< Coefficients mask
     111    psF32 ****coeff;                   ///< Coefficients
     112    psF32 ****coeffErr;                ///< Error in coefficients
     113    psU8 ****mask;                     ///< Coefficients mask
    114114}
    115115psPolynomial4D;
     
    160160/** Evaluates a 1-D polynomial at specific coordinates.
    161161 *
    162  *  @return float    result of polynomial at given location
    163  */
    164 float psPolynomial1DEval(
     162 *  @return psF32    result of polynomial at given location
     163 */
     164psF32 psPolynomial1DEval(
    165165    const psPolynomial1D* myPoly,       ///< Coefficients for the polynomial
    166     float x                           ///< location at which to evaluate
     166    psF32 x                           ///< location at which to evaluate
    167167);
    168168
    169169/** Evaluates a 2-D polynomial at specific coordinates.
    170170 *
    171  *  @return float    result of polynomial at given location
    172  */
    173 float psPolynomial2DEval(
     171 *  @return psF32    result of polynomial at given location
     172 */
     173psF32 psPolynomial2DEval(
    174174    const psPolynomial2D* myPoly,       ///< Coefficients for the polynomial
    175     float x,                           ///< x location at which to evaluate
    176     float y                           ///< y location at which to evaluate
     175    psF32 x,                           ///< x location at which to evaluate
     176    psF32 y                           ///< y location at which to evaluate
    177177);
    178178
    179179/** Evaluates a 3-D polynomial at specific coordinates.
    180180 *
    181  *  @return float    result of polynomial at given location
    182  */
    183 float psPolynomial3DEval(
     181 *  @return psF32    result of polynomial at given location
     182 */
     183psF32 psPolynomial3DEval(
    184184    const psPolynomial3D* myPoly,       ///< Coefficients for the polynomial
    185     float x,                           ///< x location at which to evaluate
    186     float y,                           ///< y location at which to evaluate
    187     float z                           ///< z location at which to evaluate
     185    psF32 x,                           ///< x location at which to evaluate
     186    psF32 y,                           ///< y location at which to evaluate
     187    psF32 z                           ///< z location at which to evaluate
    188188);
    189189
    190190/** Evaluates a 4-D polynomial at specific coordinates.
    191191 *
    192  *  @return float    result of polynomial at given location
    193  */
    194 float psPolynomial4DEval(
     192 *  @return psF32    result of polynomial at given location
     193 */
     194psF32 psPolynomial4DEval(
    195195    const psPolynomial4D* myPoly,       ///< Coefficients for the polynomial
    196     float w,                           ///< w location at which to evaluate
    197     float x,                           ///< x location at which to evaluate
    198     float y,                           ///< y location at which to evaluate
    199     float z                           ///< z location at which to evaluate
     196    psF32 w,                           ///< w location at which to evaluate
     197    psF32 x,                           ///< x location at which to evaluate
     198    psF32 y,                           ///< y location at which to evaluate
     199    psF32 z                           ///< z location at which to evaluate
    200200);
    201201
     
    235235    psPolynomialType type;             ///< Polynomial type
    236236    psS32 n;                             ///< Number of terms
    237     double *coeff;                     ///< Coefficients
    238     double *coeffErr;                  ///< Error in coefficients
    239     char *mask;                        ///< Coefficient mask
     237    psF64 *coeff;                     ///< Coefficients
     238    psF64 *coeffErr;                  ///< Error in coefficients
     239    psU8 *mask;                        ///< Coefficient mask
    240240}
    241241psDPolynomial1D;
     
    247247    psS32 nX;                            ///< Number of terms in x
    248248    psS32 nY;                            ///< Number of terms in y
    249     double **coeff;                    ///< Coefficients
    250     double **coeffErr;                 ///< Error in coefficients
    251     char **mask;                       ///< Coefficients mask
     249    psF64 **coeff;                    ///< Coefficients
     250    psF64 **coeffErr;                 ///< Error in coefficients
     251    psU8 **mask;                       ///< Coefficients mask
    252252}
    253253psDPolynomial2D;
     
    260260    psS32 nY;                            ///< Number of terms in y
    261261    psS32 nZ;                            ///< Number of terms in z
    262     double ***coeff;                   ///< Coefficients
    263     double ***coeffErr;                ///< Error in coefficients
    264     char ***mask;                      ///< Coefficient mask
     262    psF64 ***coeff;                   ///< Coefficients
     263    psF64 ***coeffErr;                ///< Error in coefficients
     264    psU8 ***mask;                      ///< Coefficient mask
    265265}
    266266psDPolynomial3D;
     
    274274    psS32 nY;                            ///< Number of terms in y
    275275    psS32 nZ;                            ///< Number of terms in z
    276     double ****coeff;                  ///< Coefficients
    277     double ****coeffErr;               ///< Error in coefficients
    278     char ****mask;                     ///< Coefficients mask
     276    psF64 ****coeff;                  ///< Coefficients
     277    psF64 ****coeffErr;               ///< Error in coefficients
     278    psU8 ****mask;                     ///< Coefficients mask
    279279}
    280280psDPolynomial4D;
     
    324324/** Evaluates a double-precision 1-D polynomial at specific coordinates.
    325325 *
    326  *  @return float    result of polynomial at given location
    327  */
    328 double psDPolynomial1DEval(
     326 *  @return psF32    result of polynomial at given location
     327 */
     328psF64 psDPolynomial1DEval(
    329329    const psDPolynomial1D* myPoly,      ///< Coefficients for the polynomial
    330     double x                          ///< Value at which to evaluate
     330    psF64 x                          ///< Value at which to evaluate
    331331);
    332332
    333333/** Evaluates a double-precision 2-D polynomial at specific coordinates.
    334334 *
    335  *  @return float    result of polynomial at given location
    336  */
    337 double psDPolynomial2DEval(
     335 *  @return psF32    result of polynomial at given location
     336 */
     337psF64 psDPolynomial2DEval(
    338338    const psDPolynomial2D* myPoly,       ///< Coefficients for the polynomial
    339     double x,                           ///< Value x at which to evaluate
    340     double y            ///< Value y at which to evaluate
     339    psF64 x,                           ///< Value x at which to evaluate
     340    psF64 y            ///< Value y at which to evaluate
    341341);
    342342
    343343/** Evaluates a double-precision 3-D polynomial at specific coordinates.
    344344 *
    345  *  @return float    result of polynomial at given location
    346  */
    347 double psDPolynomial3DEval(
     345 *  @return psF32    result of polynomial at given location
     346 */
     347psF64 psDPolynomial3DEval(
    348348    const psDPolynomial3D* myPoly,      ///< Coefficients for the polynomial
    349     double x,                          ///< Value x at which to evaluate
    350     double y,                          ///< Value y at which to evaluate
    351     double z     ///< Value z at which to evaluate
     349    psF64 x,                          ///< Value x at which to evaluate
     350    psF64 y,                          ///< Value y at which to evaluate
     351    psF64 z     ///< Value z at which to evaluate
    352352);
    353353
    354354/** Evaluates a double-precision 4-D polynomial at specific coordinates.
    355355 *
    356  *  @return float    result of polynomial at given location
    357  */
    358 double psDPolynomial4DEval(
     356 *  @return psF32    result of polynomial at given location
     357 */
     358psF64 psDPolynomial4DEval(
    359359    const psDPolynomial4D* myPoly,      ///< Coefficients for the polynomial
    360     double w,                          ///< Value w at which to evaluate
    361     double x,                          ///< Value x at which to evaluate
    362     double y,                          ///< Value y at which to evaluate
    363     double z     ///< Value z at which to evaluate
     360    psF64 w,                          ///< Value w at which to evaluate
     361    psF64 x,                          ///< Value x at which to evaluate
     362    psF64 y,                          ///< Value y at which to evaluate
     363    psF64 z     ///< Value z at which to evaluate
    364364);
    365365
     
    396396    psS32 n;                        ///< The number of spline polynomials
    397397    psPolynomial1D **spline;      ///< An array of n pointers to the spline polynomials
    398     float *p_psDeriv2;            ///< For cubic splines, the second derivative at each domain point.  Size is n+1.
    399     float *domains;               ///< The boundaries between each spline piece.  Size is n+1.
     398    psF32 *p_psDeriv2;            ///< For cubic splines, the second derivative at each domain point.  Size is n+1.
     399    psF32 *domains;               ///< The boundaries between each spline piece.  Size is n+1.
    400400}
    401401psSpline1D;
     
    403403psSpline1D *psSpline1DAlloc(psS32 n,
    404404                            psS32 order,
    405                             float min,
    406                             float max);
     405                            psF32 min,
     406                            psF32 max);
    407407
    408408psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
    409409                                   psS32 order);
    410410
    411 float psSpline1DEval(
    412     float x,
     411psF32 psSpline1DEval(
     412    psF32 x,
    413413    const psSpline1D *spline
    414414);
     
    427427                                psScalar *x);
    428428
    429 float p_psNRSpline1DEval(psSpline1D *spline,
     429psF32 p_psNRSpline1DEval(psSpline1D *spline,
    430430                         const psVector* restrict x,
    431431                         const psVector* restrict y,
    432                          float X);
     432                         psF32 X);
    433433
    434434/* \} */// End of MathGroup Functions
Note: See TracChangeset for help on using the changeset viewer.