Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 2197)
+++ trunk/psLib/src/math/psStats.c	(revision 2204)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-26 21:24:43 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -51,5 +51,5 @@
 
 void p_psVectorRobustStats(const psVector* restrict myVector,
-                           const psVector* restrict maskVector, unsigned int maskVal, psStats* stats);
+                           const psVector* restrict maskVector, psU32 maskVal, psStats* stats);
 
 
@@ -75,5 +75,5 @@
 /*****************************************************************************/
 
-bool p_psGetStatValue(const psStats* stats, double *value)
+psBool p_psGetStatValue(const psStats* stats, double *value)
 {
 
@@ -134,7 +134,7 @@
  *****************************************************************************/
 
-void p_psVectorPrint(psVector* myVector, psVector* maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable.
+void p_psVectorPrint(psVector* myVector, psVector* maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable.
 
     for (i = 0; i < myVector->n; i++) {
@@ -178,9 +178,9 @@
 
 void p_psVectorSampleMean(const psVector* restrict myVector,
-                          const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
+                          const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
     float mean = 0.0;           // The mean
-    int count = 0;              // # of points in this mean?
+    psS32 count = 0;              // # of points in this mean?
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -242,7 +242,7 @@
  *****************************************************************************/
 void p_psVectorMax(const psVector* restrict myVector,
-                   const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
+                   const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
     float max = -MY_MAX_FLOAT;  // The calculated maximum
     float rangeMin = 0.0;       // Exclude data below this
@@ -303,7 +303,7 @@
  *****************************************************************************/
 void p_psVectorMin(const psVector* restrict myVector,
-                   const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
+                   const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
     float min = MY_MAX_FLOAT;   // The calculated maximum
     float rangeMin = 0.0;       // Exclude data below this
@@ -363,9 +363,9 @@
     NULL
  *****************************************************************************/
-int p_psVectorNValues(const psVector* restrict myVector,
-                      const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
-    int numData = 0;            // The number of data points
+psS32 p_psVectorNValues(const psVector* restrict myVector,
+                        const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
+    psS32 numData = 0;            // The number of data points
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -414,11 +414,11 @@
  *****************************************************************************/
 void p_psVectorSampleMedian(const psVector* restrict myVector,
-                            const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
+                            const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
 {
     psVector* unsortedVector = NULL;    // Temporary vector
     psVector* sortedVector = NULL;      // Temporary vector
-    int i = 0;                  // Loop index variable
-    int count = 0;              // # of points in this mean?
-    int nValues = 0;            // # of points in vector
+    psS32 i = 0;                  // Loop index variable
+    psS32 count = 0;              // # of points in this mean?
+    psS32 nValues = 0;            // # of points in vector
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -497,13 +497,13 @@
                                        float sigma)
 {
-    int i = 0;                  // Loop index variable
-    int j = 0;                  // Loop index variable
+    psS32 i = 0;                  // Loop index variable
+    psS32 j = 0;                  // Loop index variable
     float iMid;
     float jMid;
-    int numBins = robustHistogram->nums->n;
-    int numBounds = robustHistogram->bounds->n;
+    psS32 numBins = robustHistogram->nums->n;
+    psS32 numBounds = robustHistogram->bounds->n;
     psVector* smooth = psVectorAlloc(numBins, PS_TYPE_F32);
-    int jMin = 0;
-    int jMax = 0;
+    psS32 jMin = 0;
+    psS32 jMax = 0;
     float firstBound = robustHistogram->bounds->data.F32[0];
     float lastBound = robustHistogram->bounds->data.F32[numBounds-1];
@@ -566,11 +566,11 @@
  *****************************************************************************/
 void p_psVectorSampleQuartiles(const psVector* restrict myVector,
-                               const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
+                               const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
 {
     psVector* unsortedVector = NULL;    // Temporary vector
     psVector* sortedVector = NULL;      // Temporary vector
-    int i = 0;                  // Loop index variable
-    int count = 0;              // # of points in this mean?
-    int nValues = 0;            // # data points
+    psS32 i = 0;                  // Loop index variable
+    psS32 count = 0;              // # of points in this mean?
+    psS32 nValues = 0;            // # data points
     float rangeMin = 0.0;       // Exclude data below this
     float rangeMax = 0.0;       // Exclude date above this
@@ -648,8 +648,8 @@
  *****************************************************************************/
 void p_psVectorSampleStdev(const psVector* restrict myVector,
-                           const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
-    int countInt = 0;           // # of data points being used
+                           const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
+    psS32 countInt = 0;           // # of data points being used
     float countFloat = 0.0;     // # of data points being used
     float mean = 0.0;           // The mean
@@ -733,8 +733,8 @@
  *****************************************************************************/
 void p_psVectorClippedStats(const psVector* restrict myVector,
-                            const psVector* restrict maskVector, unsigned int maskVal, psStats* stats)
-{
-    int i = 0;                  // Loop index variable
-    int j = 0;                  // Loop index variable
+                            const psVector* restrict maskVector, psU32 maskVal, psStats* stats)
+{
+    psS32 i = 0;                  // Loop index variable
+    psS32 j = 0;                  // Loop index variable
     float clippedMean = 0.0;    // self-explanatory
     float clippedStdev = 0.0;   // self-explanatory
@@ -825,5 +825,5 @@
     float min = (float)HUGE;
     float max = (float)-HUGE;
-    int i = 0;
+    psS32 i = 0;
 
     for (i = 0; i < myData->n; i++) {
@@ -856,5 +856,5 @@
     float max = (double)-HUGE;
     double range = 0.0;
-    int i = 0;
+    psS32 i = 0;
 
     for (i = 0; i < myData->n; i++) {
@@ -914,5 +914,5 @@
  *****************************************************************************/
 float p_psGaussianDeriv(const psVector* restrict myData,
-                        const psVector* restrict myParams, int whichParam)
+                        const psVector* restrict myParams, psS32 whichParam)
 {
     float x = myData->data.F32[0];
@@ -957,5 +957,5 @@
  *****************************************************************************/
 float p_psQuadraticDeriv(const psVector* restrict myParams,
-                         const psVector* restrict myCoords, int whichParamDeriv)
+                         const psVector* restrict myCoords, psS32 whichParamDeriv)
 {
     float x = myCoords->data.F32[0];
@@ -989,5 +989,5 @@
                        float getThisValue)
 {
-    int numIterations = 0;
+    psS32 numIterations = 0;
     float midpoint = 0.0;
     float oldMidpoint = 1.0;
@@ -1030,5 +1030,5 @@
 float fitQuadraticSearchForYThenReturnX(psVector *xVec,
                                         psVector *yVec,
-                                        int binNum,
+                                        psS32 binNum,
                                         float yVal)
 {
@@ -1129,5 +1129,5 @@
 void p_psVectorRobustStats(const psVector* restrict myVector,
                            const psVector* restrict maskVector,
-                           unsigned int maskVal,
+                           psU32 maskVal,
                            psStats* stats)
 {
@@ -1135,12 +1135,12 @@
     psVector* robustHistogramVector = NULL;
     float binSize = 0.0;        // Size of the histogram bins
-    int LQBinNum = -1;          // Bin num for lower quartile
-    int UQBinNum = -1;          // Bin num for upper quartile
-    int medianBinNum = -1;
-    int i = 0;                  // Loop index variable
-    int modeBinNum = 0;
+    psS32 LQBinNum = -1;          // Bin num for lower quartile
+    psS32 UQBinNum = -1;          // Bin num for upper quartile
+    psS32 medianBinNum = -1;
+    psS32 i = 0;                  // Loop index variable
+    psS32 modeBinNum = 0;
     float modeBinCount = 0.0;
     float dL = 0.0;
-    int numBins = 0;
+    psS32 numBins = 0;
     float myMean = 0.0;
     float myStdev = 0.0;
@@ -1200,5 +1200,5 @@
     // bins, not the binSize.  Also, if we get here, we know that
     // binSize != 0.0.
-    numBins = (int)((stats->max - stats->min) / binSize);
+    numBins = (psS32)((stats->max - stats->min) / binSize);
     robustHistogram = psHistogramAlloc(stats->min, stats->max, numBins);
 
@@ -1440,7 +1440,7 @@
     The histogram structure
  *****************************************************************************/
-psHistogram* psHistogramAlloc(float lower, float upper, int n)
-{
-    int i = 0;                  // Loop index variable
+psHistogram* psHistogramAlloc(float lower, float upper, psS32 n)
+{
+    psS32 i = 0;                  // Loop index variable
     psHistogram* newHist = NULL;        // The new histogram structure
     float binSize = 0.0;        // The histogram bin size
@@ -1500,5 +1500,5 @@
 {
     psHistogram* newHist = NULL;        // The new histogram structure
-    int i;                      // Loop index variable
+    psS32 i;                      // Loop index variable
 
     // NOTE: Verify that this is the correct action.
@@ -1565,15 +1565,15 @@
                                const psVector* restrict in,
                                const psVector* restrict mask,
-                               unsigned int maskVal)
-{
-    int i = 0;                  // Loop index variable
+                               psU32 maskVal)
+{
+    psS32 i = 0;                  // Loop index variable
     float binSize = 0.0;        // Histogram bin size
-    int binNum = 0;             // A temporary bin number
-    int numBins = 0;            // The total number of bins
-    int tmp = 0;
+    psS32 binNum = 0;             // A temporary bin number
+    psS32 numBins = 0;            // The total number of bins
+    psS32 tmp = 0;
     psScalar tmpScalar;
     tmpScalar.type.type = PS_TYPE_F32;
     psVector* inF32;
-    int mustFreeTmp = 1;
+    psS32 mustFreeTmp = 1;
 
     // NOTE: Verify that this is the correct action.
@@ -1629,5 +1629,5 @@
                 if (out->uniform == true) {
                     binSize = out->bounds->data.F32[1] - out->bounds->data.F32[0];
-                    binNum = (int)((inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize);
+                    binNum = (psS32)((inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize);
 
                     // NOTE: This next if-statement really shouldn't be necessary.
@@ -1673,5 +1673,5 @@
 psVector* p_psConvertToF32(psVector* in)
 {
-    int i = 0;
+    psS32 i = 0;
     psVector* tmp = NULL;
 
@@ -1724,8 +1724,8 @@
                        psVector* in,
                        psVector* mask,
-                       unsigned int maskVal)
+                       psU32 maskVal)
 {
     psVector* inF32;
-    int mustFreeTmp = 1;
+    psS32 mustFreeTmp = 1;
 
     if (in == NULL) {
