Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 1879)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 1879)
@@ -0,0 +1,10 @@
+//
+// Source code comments.
+//
+
+#define DETERMINE_BRACKET_STEP_SIZE 0.10
+#define MAX_LMM_ITERATIONS 100
+#define MAX_MINIMIZE_ITERATIONS 100
+#define LEFT_SPLINE_DERIV 0.0
+#define RIGHT_SPLINE_DERIV 0.0
+
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 1878)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 1879)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-23 06:12:22 $
+ *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -730,8 +730,16 @@
 
     PS_CHECK_NULL_1DPOLY(myPoly);
-    PS_CHECK_NULL_VECTOR(x);
-    PS_CHECK_EMPTY_VECTOR(x);
     PS_CHECK_NULL_VECTOR(y);
     PS_CHECK_EMPTY_VECTOR(y);
+
+    // XXX: Verify that this is the correct action.
+    if (x == NULL) {
+        x = psVectorAlloc(y->n, PS_TYPE_F32);
+        for (i=0;i<x->n;i++) {
+            x->data.F32[i] = (float) i;
+        }
+    }
+
+    PS_CHECK_EMPTY_VECTOR(x);
     PS_CHECK_NULL_VECTOR(yErr);
     PS_CHECK_EMPTY_VECTOR(yErr);
Index: /trunk/psLib/src/dataManip/psStats.c
===================================================================
--- /trunk/psLib/src/dataManip/psStats.c	(revision 1878)
+++ /trunk/psLib/src/dataManip/psStats.c	(revision 1879)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-22 01:30:21 $
+ *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -23,7 +23,5 @@
 
 /*****************************************************************************/
-
 /* INCLUDE FILES                                                             */
-
 /*****************************************************************************/
 #include "psMemory.h"
@@ -38,7 +36,5 @@
 
 /*****************************************************************************/
-
 /* DEFINE STATEMENTS                                                         */
-
 /*****************************************************************************/
 // will use robust statistical methods.
@@ -88,13 +84,9 @@
 
 /*****************************************************************************/
-
 /* TYPE DEFINITIONS                                                          */
-
 /*****************************************************************************/
 
 /*****************************************************************************/
-
 /* GLOBAL VARIABLES                                                          */
-
 /*****************************************************************************/
 
@@ -102,7 +94,5 @@
 
 /*****************************************************************************/
-
 /* FILE STATIC VARIABLES                                                     */
-
 /*****************************************************************************/
 
@@ -110,7 +100,5 @@
 
 /*****************************************************************************/
-
 /* FUNCTION IMPLEMENTATION - LOCAL                                           */
-
 /*****************************************************************************/
 
@@ -471,7 +459,4 @@
     // regardless of the vector size.
     /*
-     * if (myVector->n > stats->sampleLimit) { psAbort(__func__, "Robust Statistic Algorithms have not yet
-     * been defined or implemented.");
-     * 
      * // Calculate the robust quartiles. stats2 = psStatsAlloc(PS_STAT_ROBUST_MEDIAN);
      * p_psVectorRobustStats(myVector, maskVector, maskVal, stats2);
@@ -1525,5 +1510,4 @@
     newStruct->sampleUQ = NAN;
     newStruct->sampleLQ = NAN;
-    newStruct->sampleLimit = 30000;
     newStruct->robustMean = NAN;
     newStruct->robustMedian = NAN;
@@ -1780,4 +1764,6 @@
 algorithms stablize, we will then macro everything and put type support in
 the various stat functions.
+ 
+XXX: Should the default data type be F64?  Since we are buying Athlons...
  *****************************************************************************/
 psVector* p_psConvertToF32(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal)
@@ -1826,5 +1812,8 @@
 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64.
  *****************************************************************************/
-psStats* psVectorStats(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal)
+psStats* psVectorStats(psStats* stats,
+                       psVector* in,
+                       psVector* mask,
+                       unsigned int maskVal)
 {
     psVector* inF32;
Index: /trunk/psLib/src/dataManip/psStats.h
===================================================================
--- /trunk/psLib/src/dataManip/psStats.h	(revision 1878)
+++ /trunk/psLib/src/dataManip/psStats.h	(revision 1879)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-11 19:16:04 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -31,4 +31,5 @@
  *  @see psStats, psVectorStats, psImageStats
  */
+// XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete?
 typedef enum {
     PS_STAT_SAMPLE_MEAN = 0x000001,
@@ -43,7 +44,7 @@
     PS_STAT_CLIPPED_MEAN = 0x000200,
     PS_STAT_CLIPPED_STDEV = 0x000400,
-    PS_STAT_MAX = 0x000800,
-    PS_STAT_MIN = 0x001000,
-    PS_STAT_USE_RANGE = 0x002000,
+    PS_STAT_MAX =  0x000800,
+    PS_STAT_MIN =  0x001000,
+    PS_STAT_USE_RANGE =  0x002000,
     PS_STAT_USE_BINSIZE = 0x004000,
     PS_STAT_ROBUST_FOR_SAMPLE = 0x008000
@@ -60,5 +61,4 @@
     double sampleUQ;            ///< upper quartile of sample
     double sampleLQ;            ///< lower quartile of sample
-    double sampleLimit;         ///<
     double robustMean;          ///< robust mean of array
     double robustMedian;        ///< robust median of array
@@ -67,9 +67,9 @@
     double robustUQ;            ///< robust upper quartile
     double robustLQ;            ///< robust lower quartile
-    double XXX;
     double robustN50;           ///<
     double robustNfit;          ///<
     double clippedMean;         ///< Nsigma clipped mean
     double clippedStdev;        ///< standard deviation after clipping
+    int clippedNvalues          ///< ???
     double clipSigma;           ///< Nsigma used for clipping; user input
     int clipIter;               ///< Number of clipping iterations; user input
@@ -86,15 +86,8 @@
  */
 psStats* psVectorStats(
-    psStats* stats,
-    ///< stats structure defines stats to be calculated and how
-
-    psVector* in,
-    ///< Vector to be analysed: must be F32
-
-    psVector* mask,
-    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
-
-    unsigned int maskVal
-    ///< Only mask elements with one of these bits set in maskVector
+    psStats* stats,    ///< stats structure defines stats to be calculated and how
+    psVector* in,    ///< Vector to be analysed: must be F32
+    psVector* mask,    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
+    unsigned int maskVal    ///< Only mask elements with one of these bits set in maskVector
 );
 
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 1879)
+++ /trunk/psLib/src/math/psConstants.h	(revision 1879)
@@ -0,0 +1,10 @@
+//
+// Source code comments.
+//
+
+#define DETERMINE_BRACKET_STEP_SIZE 0.10
+#define MAX_LMM_ITERATIONS 100
+#define MAX_MINIMIZE_ITERATIONS 100
+#define LEFT_SPLINE_DERIV 0.0
+#define RIGHT_SPLINE_DERIV 0.0
+
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 1878)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 1879)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-23 06:12:22 $
+ *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -730,8 +730,16 @@
 
     PS_CHECK_NULL_1DPOLY(myPoly);
-    PS_CHECK_NULL_VECTOR(x);
-    PS_CHECK_EMPTY_VECTOR(x);
     PS_CHECK_NULL_VECTOR(y);
     PS_CHECK_EMPTY_VECTOR(y);
+
+    // XXX: Verify that this is the correct action.
+    if (x == NULL) {
+        x = psVectorAlloc(y->n, PS_TYPE_F32);
+        for (i=0;i<x->n;i++) {
+            x->data.F32[i] = (float) i;
+        }
+    }
+
+    PS_CHECK_EMPTY_VECTOR(x);
     PS_CHECK_NULL_VECTOR(yErr);
     PS_CHECK_EMPTY_VECTOR(yErr);
Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 1878)
+++ /trunk/psLib/src/math/psStats.c	(revision 1879)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-22 01:30:21 $
+ *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -23,7 +23,5 @@
 
 /*****************************************************************************/
-
 /* INCLUDE FILES                                                             */
-
 /*****************************************************************************/
 #include "psMemory.h"
@@ -38,7 +36,5 @@
 
 /*****************************************************************************/
-
 /* DEFINE STATEMENTS                                                         */
-
 /*****************************************************************************/
 // will use robust statistical methods.
@@ -88,13 +84,9 @@
 
 /*****************************************************************************/
-
 /* TYPE DEFINITIONS                                                          */
-
 /*****************************************************************************/
 
 /*****************************************************************************/
-
 /* GLOBAL VARIABLES                                                          */
-
 /*****************************************************************************/
 
@@ -102,7 +94,5 @@
 
 /*****************************************************************************/
-
 /* FILE STATIC VARIABLES                                                     */
-
 /*****************************************************************************/
 
@@ -110,7 +100,5 @@
 
 /*****************************************************************************/
-
 /* FUNCTION IMPLEMENTATION - LOCAL                                           */
-
 /*****************************************************************************/
 
@@ -471,7 +459,4 @@
     // regardless of the vector size.
     /*
-     * if (myVector->n > stats->sampleLimit) { psAbort(__func__, "Robust Statistic Algorithms have not yet
-     * been defined or implemented.");
-     * 
      * // Calculate the robust quartiles. stats2 = psStatsAlloc(PS_STAT_ROBUST_MEDIAN);
      * p_psVectorRobustStats(myVector, maskVector, maskVal, stats2);
@@ -1525,5 +1510,4 @@
     newStruct->sampleUQ = NAN;
     newStruct->sampleLQ = NAN;
-    newStruct->sampleLimit = 30000;
     newStruct->robustMean = NAN;
     newStruct->robustMedian = NAN;
@@ -1780,4 +1764,6 @@
 algorithms stablize, we will then macro everything and put type support in
 the various stat functions.
+ 
+XXX: Should the default data type be F64?  Since we are buying Athlons...
  *****************************************************************************/
 psVector* p_psConvertToF32(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal)
@@ -1826,5 +1812,8 @@
 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64.
  *****************************************************************************/
-psStats* psVectorStats(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal)
+psStats* psVectorStats(psStats* stats,
+                       psVector* in,
+                       psVector* mask,
+                       unsigned int maskVal)
 {
     psVector* inF32;
Index: /trunk/psLib/src/math/psStats.h
===================================================================
--- /trunk/psLib/src/math/psStats.h	(revision 1878)
+++ /trunk/psLib/src/math/psStats.h	(revision 1879)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-08-11 19:16:04 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-24 20:08:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -31,4 +31,5 @@
  *  @see psStats, psVectorStats, psImageStats
  */
+// XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete?
 typedef enum {
     PS_STAT_SAMPLE_MEAN = 0x000001,
@@ -43,7 +44,7 @@
     PS_STAT_CLIPPED_MEAN = 0x000200,
     PS_STAT_CLIPPED_STDEV = 0x000400,
-    PS_STAT_MAX = 0x000800,
-    PS_STAT_MIN = 0x001000,
-    PS_STAT_USE_RANGE = 0x002000,
+    PS_STAT_MAX =  0x000800,
+    PS_STAT_MIN =  0x001000,
+    PS_STAT_USE_RANGE =  0x002000,
     PS_STAT_USE_BINSIZE = 0x004000,
     PS_STAT_ROBUST_FOR_SAMPLE = 0x008000
@@ -60,5 +61,4 @@
     double sampleUQ;            ///< upper quartile of sample
     double sampleLQ;            ///< lower quartile of sample
-    double sampleLimit;         ///<
     double robustMean;          ///< robust mean of array
     double robustMedian;        ///< robust median of array
@@ -67,9 +67,9 @@
     double robustUQ;            ///< robust upper quartile
     double robustLQ;            ///< robust lower quartile
-    double XXX;
     double robustN50;           ///<
     double robustNfit;          ///<
     double clippedMean;         ///< Nsigma clipped mean
     double clippedStdev;        ///< standard deviation after clipping
+    int clippedNvalues          ///< ???
     double clipSigma;           ///< Nsigma used for clipping; user input
     int clipIter;               ///< Number of clipping iterations; user input
@@ -86,15 +86,8 @@
  */
 psStats* psVectorStats(
-    psStats* stats,
-    ///< stats structure defines stats to be calculated and how
-
-    psVector* in,
-    ///< Vector to be analysed: must be F32
-
-    psVector* mask,
-    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
-
-    unsigned int maskVal
-    ///< Only mask elements with one of these bits set in maskVector
+    psStats* stats,    ///< stats structure defines stats to be calculated and how
+    psVector* in,    ///< Vector to be analysed: must be F32
+    psVector* mask,    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
+    unsigned int maskVal    ///< Only mask elements with one of these bits set in maskVector
 );
 
