Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 1928)
+++ trunk/psLib/src/math/psStats.c	(revision 1963)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-29 19:52:53 $
+ *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-05 22:47:21 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -836,8 +836,8 @@
 
 /*****************************************************************************
-p_psNormalizeVector(myData): this is a private function which normalizes the
+p_psNormalizeVectorF32(myData): this is a private function which normalizes the
 elements of a vector to a range between 0.0 and 1.0.
  *****************************************************************************/
-void p_psNormalizeVector(psVector* myData)
+void p_psNormalizeVectorF32(psVector* myData)
 {
     float min = (float)HUGE;
@@ -867,14 +867,11 @@
 p_psNormalizeVectorF64(myData): this is a private function which normalizes the
 elements of a vector to a range between -1.0 and 1.0.
- 
-XXX: incorporate this into above
- 
 XXX: 0-1 or -1:1?
  *****************************************************************************/
 void p_psNormalizeVectorF64(psVector* myData)
 {
-    float min = (float)HUGE;
-    float max = (float)-HUGE;
-    float range = 0.0;
+    float min = (double)HUGE;
+    float max = (double)-HUGE;
+    double range = 0.0;
     int i = 0;
 
@@ -892,4 +889,20 @@
         myData->data.F64[i] = -1.0 + 2.0 *
                               ((myData->data.F64[i] - min) / range);
+    }
+
+    //    for (i = 0; i < myData->n; i++) {
+    //        myData->data.F64[i] = (myData->data.F64[i] - 0.5 * (min + max)) /
+    //                              (0.5 * (max - min));
+    //    }
+}
+
+void p_psNormalizeVector(psVector* myData)
+{
+    if (myData->type.type == PS_TYPE_F32) {
+        p_psNormalizeVectorF32(myData);
+    } else if (myData->type.type == PS_TYPE_F64) {
+        p_psNormalizeVectorF64(myData);
+    } else {
+        psError(__func__, "Unalowable data type.\n");
     }
 }
@@ -1191,5 +1204,5 @@
     // The following was necessary to fit a gaussian to the data, since
     // gaussian functions produce data between 0.0 and 1.0.
-    // p_psNormalizeVector(robustHistogramVector);
+    // p_psNormalizeVectorF32(robustHistogramVector);
 
     /**************************************************************************
