Changeset 1382 for trunk/psLib/src/math/psSpline.h
- Timestamp:
- Aug 4, 2004, 12:11:09 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psSpline.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psSpline.h
r1342 r1382 1 1 /** @file psFunctions.h 2 * \brief Standard Mathematical Functions.3 * \ingroup Stats4 *5 * This file will hold the prototypes for procedures which allocate, free,6 * and evaluate various polynomials. Those polynomial structures are also7 * defined here.8 *9 * @ingroup Stats10 *11 * @author Someone at IfA12 * @author George Gusciora, MHPCC13 *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 Hawaii18 */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 */ 19 19 20 20 #if !defined(PS_FUNCTIONS_H) 21 21 #define PS_FUNCTIONS_H 22 23 #include <stdbool.h> 24 22 25 #include "psVector.h" 23 26 … … 31 34 32 35 float 33 psGaussian( float x,///< Value at which to evaluate34 float mean,///< Mean for the Gaussian35 float stddev,///< Standard deviation for the Gaussian36 boolnormal ///< Indicates whether result should be normalized36 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 37 40 ); 38 39 41 42 40 43 /** Produce a vector of random numbers from a Gaussian distribution with 41 44 the specified mean and sigma */ 42 psVector *psGaussianDev( float mean,///< The mean of the Gaussian43 float sigma,///< The sigma of the Gaussian44 int Npts); ///< The size of the vector45 46 47 48 49 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 52 50 53 /** One-dimensional polynomial */ 51 54 typedef struct 52 {53 int n; ///< Number of terms54 float *coeff; ///< Coefficients55 float *coeffErr; ///< Error in coefficients56 char *mask; ///< Coefficient mask57 }55 { 56 int n; ///< Number of terms 57 float *coeff; ///< Coefficients 58 float *coeffErr; ///< Error in coefficients 59 char *mask; ///< Coefficient mask 60 } 58 61 psPolynomial1D; 59 62 60 63 /** Two-dimensional polynomial */ 61 64 typedef struct 62 {63 int nX, nY; ///< Number of terms in x and y64 float **coeff; ///< Coefficients65 float **coeffErr; ///< Error in coefficients66 char **mask; ///< Coefficients mask67 }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 } 68 71 psPolynomial2D; 69 72 70 73 /** Three-dimensional polynomial */ 71 74 typedef struct 72 {73 int nX, nY, nZ; ///< Number of terms in x, y and z74 float ***coeff; ///< Coefficients75 float ***coeffErr; ///< Error in coefficients76 char ***mask; ///< Coefficients mask77 }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 } 78 81 psPolynomial3D; 79 82 80 83 /** Four-dimensional polynomial */ 81 84 typedef struct 82 {83 int nW, nX, nY, nZ; ///< Number of terms in w, x, y and z84 float ****coeff; ///< Coefficients85 float ****coeffErr; ///< Error in coefficients86 char ****mask; ///< Coefficients mask87 }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 } 88 91 psPolynomial4D; 89 92 … … 92 95 93 96 /** Constructor */ 94 psPolynomial1D *psPolynomial1DAlloc( int n ///< Number of terms95 ); 96 /** Constructor */ 97 psPolynomial2D *psPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y98 ); 99 /** Constructor */ 100 psPolynomial3D *psPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z101 ); 102 /** Constructor */ 103 psPolynomial4D *psPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z104 ); 105 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 107 ); 108 106 109 /** Evaluate 1D polynomial */ 107 110 float 108 psPolynomial1DEval( float x,///< Value at which to evaluate109 const psPolynomial1D *myPoly ///< Coefficients for the polynomial110 ); 111 111 psPolynomial1DEval( float x, ///< Value at which to evaluate 112 const psPolynomial1D *myPoly ///< Coefficients for the polynomial 113 ); 114 112 115 /** Evaluate 2D polynomial */ 113 116 float 114 psPolynomial2DEval( float x,///< Value x at which to evaluate115 float y,///< Value y at which to evaluate116 const psPolynomial2D *myPoly ///< Coefficients for the polynomial117 ); 118 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 ); 121 119 122 /** Evaluate 3D polynomial */ 120 123 float 121 psPolynomial3DEval( float x,///< Value x at which to evaluate122 float y,///< Value y at which to evaluate123 float z,///< Value z at which to evaluate124 const psPolynomial3D *myPoly ///< Coefficients for the polynomial125 ); 126 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 ); 129 127 130 /** Evaluate 4D polynomial */ 128 131 float 129 psPolynomial4DEval( float w,///< Value w at which to evaluate130 float x,///< Value x at which to evaluate131 float y,///< Value y at which to evaluate132 float z,///< Value z at which to evaluate133 const psPolynomial4D *myPoly ///< Coefficients for the polynomial134 ); 135 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 ); 138 136 139 /*****************************************************************************/ 137 140 … … 140 143 /** Double-precision one-dimensional polynomial */ 141 144 typedef struct 142 {143 int n; ///< Number of terms144 double *coeff; ///< Coefficients145 double *coeffErr; ///< Error in coefficients146 char *mask; ///< Coefficient mask147 }145 { 146 int n; ///< Number of terms 147 double *coeff; ///< Coefficients 148 double *coeffErr; ///< Error in coefficients 149 char *mask; ///< Coefficient mask 150 } 148 151 psDPolynomial1D; 149 152 150 153 /** Double-precision two-dimensional polynomial */ 151 154 typedef struct 152 {153 int nX, nY; ///< Number of terms in x and y154 double **coeff; ///< Coefficients155 double **coeffErr; ///< Error in coefficients156 char **mask; ///< Coefficients mask157 }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 } 158 161 psDPolynomial2D; 159 162 160 163 /** Double-precision three-dimensional polynomial */ 161 164 typedef struct 162 {163 int nX, nY, nZ; ///< Number of terms in x, y and z164 double ***coeff; ///< Coefficients165 double ***coeffErr; ///< Error in coefficients166 char ***mask; ///< Coefficient mask167 }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 } 168 171 psDPolynomial3D; 169 172 170 173 /** Double-precision four-dimensional polynomial */ 171 174 typedef struct 172 {173 int nW, nX, nY, nZ; ///< Number of terms in w, x, y and z174 double ****coeff; ///< Coefficients175 double ****coeffErr; ///< Error in coefficients176 char ****mask; ///< Coefficients mask177 }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 } 178 181 psDPolynomial4D; 179 182 180 183 /** Constructor */ 181 psDPolynomial1D *psDPolynomial1DAlloc( int n ///< Number of terms182 ); 183 /** Constructor */ 184 psDPolynomial2D *psDPolynomial2DAlloc( int nX, int nY ///< Number of terms in x and y185 ); 186 /** Constructor */ 187 psDPolynomial3D *psDPolynomial3DAlloc( int nX, int nY, int nZ ///< Number of terms in x, y and z188 ); 189 /** Constructor */ 190 psDPolynomial4D *psDPolynomial4DAlloc( int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and z191 ); 192 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 194 ); 195 193 196 /** Evaluate 1D polynomial (double precision) */ 194 197 double 195 psDPolynomial1DEval( double x,///< Value at which to evaluate196 const psDPolynomial1D *myPoly ///< Coefficients for the polynomial197 ); 198 198 psDPolynomial1DEval( double x, ///< Value at which to evaluate 199 const psDPolynomial1D *myPoly ///< Coefficients for the polynomial 200 ); 201 199 202 /** Evaluate 2D polynomial (double precision) */ 200 203 double 201 psDPolynomial2DEval( double x,///< Value x at which to evaluate202 double y,///< Value y at which to evaluate203 const psDPolynomial2D *myPoly ///< Coefficients for the polynomial204 ); 205 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 ); 208 206 209 /** Evaluate 3D polynomial (double precision) */ 207 210 double 208 psDPolynomial3DEval( double x,///< Value x at which to evaluate209 double y,///< Value y at which to evaluate210 double z,///< Value z at which to evaluate211 const psDPolynomial3D *myPoly ///< Coefficients for the polynomial212 ); 213 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 ); 216 214 217 /** Evaluate 4D polynomial (double precision) */ 215 218 double 216 psDPolynomial4DEval( double w,///< Value w at which to evaluate217 double x,///< Value x at which to evaluate218 double y,///< Value y at which to evaluate219 double z,///< Value z at which to evaluate220 const psDPolynomial4D *myPoly ///< Coefficients for the polynomial221 ); 222 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 223 226 /* \} */ // End of MathGroup Functions 224 227
Note:
See TracChangeset
for help on using the changeset viewer.
