Index: trunk/psLib/src/dataManip/psStats.c
===================================================================
--- trunk/psLib/src/dataManip/psStats.c	(revision 2220)
+++ trunk/psLib/src/dataManip/psStats.c	(revision 2221)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.75 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 21:55:09 $
+ *  @version $Revision: 1.76 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 23:31:43 $
 n *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,5 +30,4 @@
 #include "psTrace.h"
 #include "psError.h"
-#include "psAbort.h"
 #include "psStats.h"
 #include "psMinimize.h"
@@ -743,9 +742,9 @@
     // Endure that stats->clipIter is within the proper range.
     if (!((PS_CLIPPED_NUM_ITER_LB <= stats->clipIter) && (stats->clipIter <= PS_CLIPPED_NUM_ITER_UB))) {
-        psAbort(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);
+        psError(__func__, "Unallowed value for clipIter (%d).\n", stats->clipIter);
     }
     // Endure that stats->clipSigma is within the proper range.
     if (!((PS_CLIPPED_SIGMA_LB <= stats->clipSigma) && (stats->clipSigma <= PS_CLIPPED_SIGMA_UB))) {
-        psAbort(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);
+        psError(__func__, "Unallowed value for clipSigma (%f).\n", stats->clipSigma);
     }
     // We allocate a temporary mask vector since during the iterative
@@ -763,5 +762,5 @@
     }
     // 1. Compute the sample median.
-    // NOTE: This seems odd.  Verify with IfA that we want to calculate the
+    // XXX: This seems odd.  Verify with IfA that we want to calculate the
     // median here, not the mean.
     p_psVectorSampleMedian(myVector, maskVector, maskVal, stats);
@@ -1453,5 +1452,5 @@
     // Calculate the bounds for each bin.
     binSize = (upper - lower) / (float)n;
-    // NOTE: Is the following necessary? It prevents the max data point
+    // XXX: Is the following necessary? It prevents the max data point
     // from being in a non-existant bin.
     binSize += FLT_EPSILON;
@@ -1546,4 +1545,5 @@
     PS_VECTOR_CHECK_TYPE(out->bounds, PS_TYPE_F32, NULL);
     PS_VECTOR_CHECK_TYPE(out->nums, PS_TYPE_U32, NULL);
+    PS_INT_CHECK_NON_NEGATIVE(out->nums->n, NULL);
     PS_VECTOR_CHECK_NULL(in, NULL);
     if (mask != NULL) {
@@ -1567,6 +1567,4 @@
     }
 
-    // NOTE: determine the correct action for a variety of other cases:
-    // in vector has 0 elements, and histogram structure has zero bins.
 
     numBins = out->nums->n;
@@ -1589,6 +1587,6 @@
                     binNum = (psS32)((inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize);
 
-                    // NOTE: This next if-statement really shouldn't be necessary.
-                    // However, do to numerical lack of precision, we occasionally
+                    // XXX: This if-statement really shouldn't be necessary.
+                    // However, due to numerical lack of precision, we occasionally
                     // produce a binNum outside the range of bins.
                     if (binNum >= out->nums->n) {
@@ -1657,5 +1655,5 @@
         // do nothing
     } else {
-        psAbort(__func__, "unsupported vector type 0x%x\n", in->type.type);
+        psError(__func__, "unsupported vector type 0x%x\n", in->type.type);
     }
     return (tmp);
@@ -1674,8 +1672,4 @@
 Returns
     The stats structure.
- 
-NOTE: The current strategy is to implement everything assuming that all
-input data is of type PS_TYPE_F32.  Once the basic code is in place, we will
-macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64.
  *****************************************************************************/
 psStats* psVectorStats(psStats* stats,
@@ -1712,5 +1706,5 @@
     }
     // ************************************************************************
-    // NOTE: The Stdev calculation requires the mean.  Should we assume the
+    // XXX: The Stdev calculation requires the mean.  Should we assume the
     // mean has already been calculated? Or should we always calculate it?
     if (stats->options & PS_STAT_SAMPLE_STDEV) {
