IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2004, 12:11:09 PM (22 years ago)
Author:
desonia
Message:

merged psAstrometry and psCCD, which had recursive header dependencies; yuk!
Also added required includes in other files to allow psAstrometry.h to
work without having to know which other include files are needed before
including a particular header file.

File:
1 edited

Legend:

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

    r1342 r1382  
    11/** @file psFunctions.h
    2  *  \brief Standard Mathematical Functions.
    3  *  \ingroup Stats
    4  *
    5  *  This file will hold the prototypes for procedures which allocate, free,
    6  *  and evaluate various polynomials.  Those polynomial structures are also
    7  *  defined here.
    8  *
    9  *  @ingroup Stats
    10  *
    11  *  @author Someone at IfA
    12  *  @author George Gusciora, MHPCC
    13  *
    14  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-07-29 23:34:24 $
    16  *
    17  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    18  */
     2*  \brief Standard Mathematical Functions.
     3*  \ingroup Stats
     4*
     5*  This file will hold the prototypes for procedures which allocate, free,
     6*  and evaluate various polynomials.  Those polynomial structures are also
     7*  defined here.
     8*
     9*  @ingroup Stats
     10*
     11*  @author Someone at IfA
     12*  @author George Gusciora, MHPCC
     13*
     14*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-04 22:11:09 $
     16*
     17*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     18*/
    1919
    2020#if !defined(PS_FUNCTIONS_H)
    2121#define PS_FUNCTIONS_H
     22
     23#include <stdbool.h>
     24
    2225#include "psVector.h"
    2326
     
    3134
    3235float
    33 psGaussian(float x,        ///< Value at which to evaluate
    34            float mean,     ///< Mean for the Gaussian
    35            float stddev,   ///< Standard deviation for the Gaussian
    36            bool normal      ///< Indicates whether result should be normalized
     36psGaussian( float x,         ///< Value at which to evaluate
     37            float mean,      ///< Mean for the Gaussian
     38            float stddev,    ///< Standard deviation for the Gaussian
     39            bool normal      ///< Indicates whether result should be normalized
    3740          );
    38 
    39 
     41         
     42         
    4043/** Produce a vector of random numbers from a Gaussian distribution with
    4144    the specified mean and sigma */
    42 psVector *psGaussianDev(float mean,    ///< The mean of the Gaussian
    43                         float sigma,   ///< The sigma of the Gaussian
    44                         int Npts);     ///< The size of the vector
    45 
    46 
    47 
    48 
    49 
     45psVector *psGaussianDev( float mean,     ///< The mean of the Gaussian
     46                         float sigma,    ///< The sigma of the Gaussian
     47                         int Npts );     ///< The size of the vector
     48                         
     49                         
     50                         
     51                         
     52                         
    5053/** One-dimensional polynomial */
    5154typedef struct
    52 {
    53     int n;           ///< Number of terms
    54     float *coeff;    ///< Coefficients
    55     float *coeffErr; ///< Error in coefficients
    56     char *mask;      ///< Coefficient mask
    57 }
     55    {
     56        int n;           ///< Number of terms
     57        float *coeff;    ///< Coefficients
     58        float *coeffErr; ///< Error in coefficients
     59        char *mask;      ///< Coefficient mask
     60    }
    5861psPolynomial1D;
    5962
    6063/** Two-dimensional polynomial */
    6164typedef struct
    62 {
    63     int nX, nY;    ///< Number of terms in x and y
    64     float **coeff;   ///< Coefficients
    65     float **coeffErr;   ///< Error in coefficients
    66     char **mask;   ///< Coefficients mask
    67 }
     65    {
     66        int nX, nY;    ///< Number of terms in x and y
     67        float **coeff;   ///< Coefficients
     68        float **coeffErr;   ///< Error in coefficients
     69        char **mask;   ///< Coefficients mask
     70    }
    6871psPolynomial2D;
    6972
    7073/** Three-dimensional polynomial */
    7174typedef struct
    72 {
    73     int nX, nY, nZ;   ///< Number of terms in x, y and z
    74     float ***coeff;    ///< Coefficients
    75     float ***coeffErr;    ///< Error in coefficients
    76     char ***mask;    ///< Coefficients mask
    77 }
     75    {
     76        int nX, nY, nZ;   ///< Number of terms in x, y and z
     77        float ***coeff;    ///< Coefficients
     78        float ***coeffErr;    ///< Error in coefficients
     79        char ***mask;    ///< Coefficients mask
     80    }
    7881psPolynomial3D;
    7982
    8083/** Four-dimensional polynomial */
    8184typedef struct
    82 {
    83     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    84     float ****coeff;    ///< Coefficients
    85     float ****coeffErr;   ///< Error in coefficients
    86     char ****mask;    ///< Coefficients mask
    87 }
     85    {
     86        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     87        float ****coeff;    ///< Coefficients
     88        float ****coeffErr;   ///< Error in coefficients
     89        char ****mask;    ///< Coefficients mask
     90    }
    8891psPolynomial4D;
    8992
     
    9295
    9396/** Constructor */
    94 psPolynomial1D *psPolynomial1DAlloc(int n ///< Number of terms
    95                                    );
    96 /** Constructor */
    97 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    98                                    );
    99 /** Constructor */
    100 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    101                                    );
    102 /** Constructor */
    103 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    104                                    );
    105 
     97psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
     98                                   );
     99/** Constructor */
     100psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     101                                   );
     102/** Constructor */
     103psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     104                                   );
     105/** Constructor */
     106psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     107                                   );
     108                                   
    106109/** Evaluate 1D polynomial */
    107110float
    108 psPolynomial1DEval(float x,  ///< Value at which to evaluate
    109                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
    110                   );
    111 
     111psPolynomial1DEval( float x,   ///< Value at which to evaluate
     112                    const psPolynomial1D *myPoly ///< Coefficients for the polynomial
     113                  );
     114                 
    112115/** Evaluate 2D polynomial */
    113116float
    114 psPolynomial2DEval(float x,  ///< Value x at which to evaluate
    115                    float y,  ///< Value y at which to evaluate
    116                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
    117                   );
    118 
     117psPolynomial2DEval( float x,   ///< Value x at which to evaluate
     118                    float y,   ///< Value y at which to evaluate
     119                    const psPolynomial2D *myPoly ///< Coefficients for the polynomial
     120                  );
     121                 
    119122/** Evaluate 3D polynomial */
    120123float
    121 psPolynomial3DEval(float x,  ///< Value x at which to evaluate
    122                    float y,  ///< Value y at which to evaluate
    123                    float z,  ///< Value z at which to evaluate
    124                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
    125                   );
    126 
     124psPolynomial3DEval( float x,   ///< Value x at which to evaluate
     125                    float y,   ///< Value y at which to evaluate
     126                    float z,   ///< Value z at which to evaluate
     127                    const psPolynomial3D *myPoly ///< Coefficients for the polynomial
     128                  );
     129                 
    127130/** Evaluate 4D polynomial */
    128131float
    129 psPolynomial4DEval(float w,  ///< Value w at which to evaluate
    130                    float x,  ///< Value x at which to evaluate
    131                    float y,  ///< Value y at which to evaluate
    132                    float z,  ///< Value z at which to evaluate
    133                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
    134                   );
    135 
     132psPolynomial4DEval( float w,   ///< Value w at which to evaluate
     133                    float x,   ///< Value x at which to evaluate
     134                    float y,   ///< Value y at which to evaluate
     135                    float z,   ///< Value z at which to evaluate
     136                    const psPolynomial4D *myPoly ///< Coefficients for the polynomial
     137                  );
     138                 
    136139/*****************************************************************************/
    137140
     
    140143/** Double-precision one-dimensional polynomial */
    141144typedef struct
    142 {
    143     int n;    ///< Number of terms
    144     double *coeff;   ///< Coefficients
    145     double *coeffErr;   ///< Error in coefficients
    146     char *mask;    ///< Coefficient mask
    147 }
     145    {
     146        int n;    ///< Number of terms
     147        double *coeff;   ///< Coefficients
     148        double *coeffErr;   ///< Error in coefficients
     149        char *mask;    ///< Coefficient mask
     150    }
    148151psDPolynomial1D;
    149152
    150153/** Double-precision two-dimensional polynomial */
    151154typedef struct
    152 {
    153     int nX, nY;    ///< Number of terms in x and y
    154     double **coeff;   ///< Coefficients
    155     double **coeffErr;    ///< Error in coefficients
    156     char **mask;   ///< Coefficients mask
    157 }
     155    {
     156        int nX, nY;    ///< Number of terms in x and y
     157        double **coeff;   ///< Coefficients
     158        double **coeffErr;    ///< Error in coefficients
     159        char **mask;   ///< Coefficients mask
     160    }
    158161psDPolynomial2D;
    159162
    160163/** Double-precision three-dimensional polynomial */
    161164typedef struct
    162 {
    163     int nX, nY, nZ;   ///< Number of terms in x, y and z
    164     double ***coeff;   ///< Coefficients
    165     double ***coeffErr;   ///< Error in coefficients
    166     char ***mask;    ///< Coefficient mask
    167 }
     165    {
     166        int nX, nY, nZ;   ///< Number of terms in x, y and z
     167        double ***coeff;   ///< Coefficients
     168        double ***coeffErr;   ///< Error in coefficients
     169        char ***mask;    ///< Coefficient mask
     170    }
    168171psDPolynomial3D;
    169172
    170173/** Double-precision four-dimensional polynomial */
    171174typedef struct
    172 {
    173     int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
    174     double ****coeff;    ///< Coefficients
    175     double ****coeffErr;   ///< Error in coefficients
    176     char ****mask;    ///< Coefficients mask
    177 }
     175    {
     176        int nW, nX, nY, nZ;   ///< Number of terms in w, x, y and z
     177        double ****coeff;    ///< Coefficients
     178        double ****coeffErr;   ///< Error in coefficients
     179        char ****mask;    ///< Coefficients mask
     180    }
    178181psDPolynomial4D;
    179182
    180183/** Constructor */
    181 psDPolynomial1D *psDPolynomial1DAlloc(int n ///< Number of terms
    182                                      );
    183 /** Constructor */
    184 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y
    185                                      );
    186 /** Constructor */
    187 psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z
    188                                      );
    189 /** Constructor */
    190 psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
    191                                      );
    192 
     184psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
     185                                     );
     186/** Constructor */
     187psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
     188                                     );
     189/** Constructor */
     190psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
     191                                     );
     192/** Constructor */
     193psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     194                                     );
     195                                     
    193196/** Evaluate 1D polynomial (double precision) */
    194197double
    195 psDPolynomial1DEval(double x,  ///< Value at which to evaluate
    196                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
    197                    );
    198 
     198psDPolynomial1DEval( double x,   ///< Value at which to evaluate
     199                     const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
     200                   );
     201                   
    199202/** Evaluate 2D polynomial (double precision) */
    200203double
    201 psDPolynomial2DEval(double x,  ///< Value x at which to evaluate
    202                     double y,  ///< Value y at which to evaluate
    203                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
    204                    );
    205 
     204psDPolynomial2DEval( double x,   ///< Value x at which to evaluate
     205                     double y,   ///< Value y at which to evaluate
     206                     const psDPolynomial2D *myPoly ///< Coefficients for the polynomial
     207                   );
     208                   
    206209/** Evaluate 3D polynomial (double precision) */
    207210double
    208 psDPolynomial3DEval(double x,  ///< Value x at which to evaluate
    209                     double y,  ///< Value y at which to evaluate
    210                     double z,  ///< Value z at which to evaluate
    211                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
    212                    );
    213 
     211psDPolynomial3DEval( double x,   ///< Value x at which to evaluate
     212                     double y,   ///< Value y at which to evaluate
     213                     double z,   ///< Value z at which to evaluate
     214                     const psDPolynomial3D *myPoly ///< Coefficients for the polynomial
     215                   );
     216                   
    214217/** Evaluate 4D polynomial (double precision) */
    215218double
    216 psDPolynomial4DEval(double w,  ///< Value w at which to evaluate
    217                     double x,  ///< Value x at which to evaluate
    218                     double y,  ///< Value y at which to evaluate
    219                     double z,  ///< Value z at which to evaluate
    220                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
    221                    );
    222 
     219psDPolynomial4DEval( double w,   ///< Value w at which to evaluate
     220                     double x,   ///< Value x at which to evaluate
     221                     double y,   ///< Value y at which to evaluate
     222                     double z,   ///< Value z at which to evaluate
     223                     const psDPolynomial4D *myPoly ///< Coefficients for the polynomial
     224                   );
     225                   
    223226/* \} */ // End of MathGroup Functions
    224227
Note: See TracChangeset for help on using the changeset viewer.