Changeset 1281 for trunk/psLib/src/dataManip
- Timestamp:
- Jul 22, 2004, 1:47:23 PM (22 years ago)
- Location:
- trunk/psLib/src/dataManip
- Files:
-
- 3 edited
-
psFunctions.c (modified) (5 diffs)
-
psMinimize.h (modified) (1 diff)
-
psStats.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r1233 r1281 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-07- 15 23:52:34$9 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-07-22 23:45:16 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 #include "psFunctions.h" 30 30 31 #include "float.h"32 #include <math.h>33 31 #include <gsl/gsl_rng.h> 34 32 #include <gsl/gsl_randist.h> 35 33 /*****************************************************************************/ 34 /* DEFINE STATEMENTS */ 35 /*****************************************************************************/ 36 37 // None 38 39 /*****************************************************************************/ 40 /* TYPE DEFINITIONS */ 41 /*****************************************************************************/ 36 42 static void polynomial1DFree(psPolynomial1D *myPoly); 37 43 static void polynomial2DFree(psPolynomial2D *myPoly); … … 44 50 45 51 /*****************************************************************************/ 52 /* GLOBAL VARIABLES */ 53 /*****************************************************************************/ 54 55 // None 56 57 /*****************************************************************************/ 58 /* FILE STATIC VARIABLES */ 59 /*****************************************************************************/ 60 61 // None 62 63 /*****************************************************************************/ 64 /* FUNCTION IMPLEMENTATION - LOCAL */ 65 /*****************************************************************************/ 66 67 // None 68 69 /*****************************************************************************/ 46 70 /* FUNCTION IMPLEMENTATION - PUBLIC */ 47 71 /*****************************************************************************/ … … 55 79 psGaussian(float x, 56 80 float mean, 57 float s tddev,81 float sigma, 58 82 int normal) 59 83 { 60 float tmp = 0.0;84 float tmp = 1.0; 61 85 62 86 if (normal == 1) { 63 87 #ifdef DARWIN 64 tmp = 1.0 / (float)sqrt(2.0 * M_PI * (s tddev * stddev));88 tmp = 1.0 / (float)sqrt(2.0 * M_PI * (sigma * sigma)); 65 89 #else 66 90 67 tmp = 1.0 / sqrtf(2.0 * M_PI * (s tddev * stddev));91 tmp = 1.0 / sqrtf(2.0 * M_PI * (sigma * sigma)); 68 92 #endif 69 93 70 return(tmp * exp(-((x-mean) * (x-mean)) / (2.0 * stddev * stddev))); 71 } else { 72 return(exp(-((x-mean) * (x-mean)) / (2.0 * stddev * stddev))); 73 } 94 } 95 96 return(tmp * exp(-((x-mean) * (x-mean)) / (2.0 * sigma * sigma))); 74 97 } 75 98 … … 328 351 float xSum = 1.0; 329 352 353 if (NULL == myPoly) { 354 psAbort(__func__, "psEvalPolynomial1D(): myPoly is NULL\n"); 355 } 356 357 330 358 // NOTE: Do we want to flag this case? 331 359 if (myPoly->n == 0) { 332 360 return(1.0); 361 } 362 363 if (NULL == myPoly->coeff) { 364 psAbort(__func__, "psEvalPolynomial1D(): myPoly->coeff is NULL\n"); 333 365 } 334 366 -
trunk/psLib/src/dataManip/psMinimize.h
r1190 r1281 2 2 #define PS_MINIMIZE_H 3 3 4 #include "psFunctions.h" 4 5 /** \file psMinimize.h 5 6 * \brief minimization operations -
trunk/psLib/src/dataManip/psStats.h
r1073 r1281 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 6-23 23:00:15$11 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-07-22 23:44:49 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 57 57 double sampleLimit; ///< 58 58 double robustMean; ///< robust mean of array 59 int robustMeanNvalues; ///< number of measurements used for robust mean60 59 double robustMedian; ///< robust median of array 61 60 double robustMode; ///< Robust mode of array
Note:
See TracChangeset
for help on using the changeset viewer.
