IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2004, 2:06:06 PM (22 years ago)
Author:
desonia
Message:

another attempt to get astyle to get it right.

File:
1 edited

Legend:

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

    r1406 r1407  
     1
    12/** @file psFunctions.h
    23*  \brief Standard Mathematical Functions.
     
    1213*  @author George Gusciora, MHPCC
    1314*
    14 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-06 22:34:05 $
     15*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2004-08-07 00:06:06 $
    1617*
    1718*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1920
    2021#if !defined(PS_FUNCTIONS_H)
    21 #define PS_FUNCTIONS_H
    22 
    23 #include <stdbool.h>
    24 
    25 #include "psVector.h"
     22#    define PS_FUNCTIONS_H
     23
     24#    include <stdbool.h>
     25
     26#    include "psVector.h"
    2627
    2728/** \addtogroup Stats
     
    3334    evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */
    3435
    35 float
    36 psGaussian( 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
    40           );
    41 
     36float psGaussian(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
     40                );
    4241
    4342/** Produce a vector of random numbers from a Gaussian distribution with
    4443    the specified mean and sigma */
    45 psVector *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 
     44psVector *psGaussianDev(float mean,     // /< The mean of the Gaussian
     45                        float sigma,    // /< The sigma of the Gaussian
     46                        int Npts);      // /< The size of the vector
    5247
    5348/** One-dimensional polynomial */
    5449typedef struct
    5550{
    56     int n;           ///< Number of terms
    57     float *coeff;    ///< Coefficients
    58     float *coeffErr; ///< Error in coefficients
    59     char *mask;      ///< Coefficient mask
     51    int n;                      // /< Number of terms
     52    float *coeff;               // /< Coefficients
     53    float *coeffErr;            // /< Error in coefficients
     54    char *mask;                 // /< Coefficient mask
    6055}
    6156psPolynomial1D;
     
    6459typedef struct
    6560{
    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
     61    int nX,
     62    nY;                       // /< Number of terms in x and y
     63    float **coeff;              // /< Coefficients
     64    float **coeffErr;           // /< Error in coefficients
     65    char **mask;                // /< Coefficients mask
    7066}
    7167psPolynomial2D;
     
    7470typedef struct
    7571{
    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
     72    int nX,
     73    nY,
     74    nZ;                       // /< Number of terms in x, y and z
     75    float ***coeff;             // /< Coefficients
     76    float ***coeffErr;          // /< Error in coefficients
     77    char ***mask;               // /< Coefficients mask
    8078}
    8179psPolynomial3D;
     
    8482typedef struct
    8583{
    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
     84    int nW,
     85    nX,
     86    nY,
     87    nZ;                       // /< Number of terms in w, x, y and z
     88    float ****coeff;            // /< Coefficients
     89    float ****coeffErr;         // /< Error in coefficients
     90    char ****mask;              // /< Coefficients mask
    9091}
    9192psPolynomial4D;
    9293
    93 
    9494/** Functions **************************************************************/
    9595
    9696/** Constructor */
    97 psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms
    98                                    );
    99 /** Constructor */
    100 psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
    101                                    );
    102 /** Constructor */
    103 psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
    104                                    );
    105 /** Constructor */
    106 psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     97psPolynomial1D *psPolynomial1DAlloc(int n       // /< Number of terms
     98                                   );
     99
     100/** Constructor */
     101psPolynomial2D *psPolynomial2DAlloc(int nX, int nY      // /< Number of terms in x and y
     102                                   );
     103
     104/** Constructor */
     105psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ      // /< Number of terms in x, y and z
     106                                   );
     107
     108/** Constructor */
     109psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ      // /< Number of terms in w, x, y and
     110                                    // z
    107111                                   );
    108112
    109113/** Evaluate 1D polynomial */
    110 float
    111 psPolynomial1DEval( float x,   ///< Value at which to evaluate
    112                     const psPolynomial1D *myPoly ///< Coefficients for the polynomial
    113                   );
     114float psPolynomial1DEval(float x,       // /< Value at which to evaluate
     115                         const psPolynomial1D * myPoly  // /< Coefficients for the polynomial
     116                        );
    114117
    115118/** Evaluate 2D polynomial */
    116 float
    117 psPolynomial2DEval( 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                   );
     119float psPolynomial2DEval(float x,       // /< Value x at which to evaluate
     120                         float y,       // /< Value y at which to evaluate
     121                         const psPolynomial2D * myPoly  // /< Coefficients for the polynomial
     122                        );
    121123
    122124/** Evaluate 3D polynomial */
    123 float
    124 psPolynomial3DEval( 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                   );
     125float psPolynomial3DEval(float x,       // /< Value x at which to evaluate
     126                         float y,       // /< Value y at which to evaluate
     127                         float z,       // /< Value z at which to evaluate
     128                         const psPolynomial3D * myPoly  // /< Coefficients for the polynomial
     129                        );
    129130
    130131/** Evaluate 4D polynomial */
    131 float
    132 psPolynomial4DEval( 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                   );
     132float psPolynomial4DEval(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                        );
    138138
    139139/*****************************************************************************/
     
    144144typedef struct
    145145{
    146     int n;    ///< Number of terms
    147     double *coeff;   ///< Coefficients
    148     double *coeffErr;   ///< Error in coefficients
    149     char *mask;    ///< Coefficient mask
     146    int n;                      // /< Number of terms
     147    double *coeff;              // /< Coefficients
     148    double *coeffErr;           // /< Error in coefficients
     149    char *mask;                 // /< Coefficient mask
    150150}
    151151psDPolynomial1D;
     
    154154typedef struct
    155155{
    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
     156    int nX,
     157    nY;                       // /< Number of terms in x and y
     158    double **coeff;             // /< Coefficients
     159    double **coeffErr;          // /< Error in coefficients
     160    char **mask;                // /< Coefficients mask
    160161}
    161162psDPolynomial2D;
     
    164165typedef struct
    165166{
    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
     167    int nX,
     168    nY,
     169    nZ;                       // /< Number of terms in x, y and z
     170    double ***coeff;            // /< Coefficients
     171    double ***coeffErr;         // /< Error in coefficients
     172    char ***mask;               // /< Coefficient mask
    170173}
    171174psDPolynomial3D;
     
    174177typedef struct
    175178{
    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
     179    int nW,
     180    nX,
     181    nY,
     182    nZ;                       // /< Number of terms in w, x, y and z
     183    double ****coeff;           // /< Coefficients
     184    double ****coeffErr;        // /< Error in coefficients
     185    char ****mask;              // /< Coefficients mask
    180186}
    181187psDPolynomial4D;
    182188
    183189/** Constructor */
    184 psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms
    185                                      );
    186 /** Constructor */
    187 psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y
    188                                      );
    189 /** Constructor */
    190 psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z
    191                                      );
    192 /** Constructor */
    193 psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z
     190psDPolynomial1D *psDPolynomial1DAlloc(int n     // /< Number of terms
     191                                     );
     192
     193/** Constructor */
     194psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY    // /< Number of terms in x and y
     195                                     );
     196
     197/** Constructor */
     198psDPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ    // /< Number of terms in x, y and z
     199                                     );
     200
     201/** Constructor */
     202psDPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ    // /< Number of terms in w, x, y and
     203                                      // z
    194204                                     );
    195205
    196206/** Evaluate 1D polynomial (double precision) */
    197 double
    198 psDPolynomial1DEval( double x,   ///< Value at which to evaluate
    199                      const psDPolynomial1D *myPoly ///< Coefficients for the polynomial
    200                    );
     207double psDPolynomial1DEval(double x,    // /< Value at which to evaluate
     208                           const psDPolynomial1D * myPoly       // /< Coefficients for the polynomial
     209                          );
    201210
    202211/** Evaluate 2D polynomial (double precision) */
    203 double
    204 psDPolynomial2DEval( 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                    );
     212double psDPolynomial2DEval(double x,    // /< Value x at which to evaluate
     213                           double y,    // /< Value y at which to evaluate
     214                           const psDPolynomial2D * myPoly       // /< Coefficients for the polynomial
     215                          );
    208216
    209217/** Evaluate 3D polynomial (double precision) */
    210 double
    211 psDPolynomial3DEval( 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                    );
     218double psDPolynomial3DEval(double x,    // /< Value x at which to evaluate
     219                           double y,    // /< Value y at which to evaluate
     220                           double z,    // /< Value z at which to evaluate
     221                           const psDPolynomial3D * myPoly       // /< Coefficients for the polynomial
     222                          );
    216223
    217224/** Evaluate 4D polynomial (double precision) */
    218 double
    219 psDPolynomial4DEval( 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 
    226 /* \} */ // End of MathGroup Functions
     225double psDPolynomial4DEval(double w,    // /< Value w at which to evaluate
     226                           double x,    // /< Value x at which to evaluate
     227                           double y,    // /< Value y at which to evaluate
     228                           double z,    // /< Value z at which to evaluate
     229                           const psDPolynomial4D * myPoly       // /< Coefficients for the polynomial
     230                          );
     231
     232/* \} */// End of MathGroup Functions
    227233
    228234#endif
Note: See TracChangeset for help on using the changeset viewer.