Index: /trunk/psLib/src/collections/psArray.c
===================================================================
--- /trunk/psLib/src/collections/psArray.c	(revision 485)
+++ /trunk/psLib/src/collections/psArray.c	(revision 486)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-21 00:18:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:40:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +19,4 @@
 #include "psMemory.h"
 #include "psArray.h"
-#include "psLogMsg.h"
 
 /******************************************************************************/
@@ -54,4 +53,46 @@
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
 /*****************************************************************************/
+
+psIntArray* psIntArrayAlloc(int nalloc)
+{
+    psIntArray *psArr = (psIntArray*)p_psAlloc(sizeof(psIntArray), __FILE__, __LINE__);
+    psArr->type.dimen = PS_DIMEN_VECTOR;
+    psArr->type.type = PS_TYPE_INT;
+    psArr->nalloc = nalloc;
+    psArr->n = 0;
+
+    if(nalloc == 0) {
+        psArr->arr = NULL;
+    } else {
+        psArr->arr = p_psAlloc(nalloc*sizeof(int), __FILE__, __LINE__);
+    }
+
+    return psArr;
+}
+
+psIntArray *psIntArrayRealloc(psIntArray *psArr, int nalloc)
+{
+    if(psArr == NULL) {
+        return psIntArrayAlloc(nalloc);
+    }
+    if(nalloc <= psArr->nalloc) {
+        if (psArr->n < nalloc) {
+            psArr->n = nalloc;
+        }
+    } else {
+        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->nalloc = nalloc;
+    }
+    return psArr;
+}
+
+void psIntArrayFree(psIntArray *restrict psArr)
+{
+    if (psArr == NULL) {
+        return;
+    }
+    p_psFree(psArr->arr, __FILE__, __LINE__);
+    p_psFree(psArr, __FILE__, __LINE__);
+}
 
 psFloatArray* psFloatArrayAlloc(int nalloc)
@@ -97,9 +138,9 @@
 }
 
-psIntArray* psIntArrayAlloc(int nalloc)
+psDoubleArray* psDoubleArrayAlloc(int nalloc)
 {
-    psIntArray *psArr = (psIntArray*)p_psAlloc(sizeof(psIntArray), __FILE__, __LINE__);
+    psDoubleArray *psArr = (psDoubleArray*)p_psAlloc(sizeof(psDoubleArray), __FILE__, __LINE__);
     psArr->type.dimen = PS_DIMEN_VECTOR;
-    psArr->type.type = PS_TYPE_INT;
+    psArr->type.type = PS_TYPE_DOUBLE;
     psArr->nalloc = nalloc;
     psArr->n = 0;
@@ -108,5 +149,5 @@
         psArr->arr = NULL;
     } else {
-        psArr->arr = p_psAlloc(nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->arr = p_psAlloc(nalloc*sizeof(double), __FILE__, __LINE__);
     }
 
@@ -114,8 +155,8 @@
 }
 
-psIntArray *psIntArrayRealloc(psIntArray *psArr, int nalloc)
+psDoubleArray *psDoubleArrayRealloc(psDoubleArray *psArr, int nalloc)
 {
     if(psArr == NULL) {
-        return psIntArrayAlloc(nalloc);
+        return psDoubleArrayAlloc(nalloc);
     }
     if(nalloc <= psArr->nalloc) {
@@ -124,5 +165,5 @@
         }
     } else {
-        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(double), __FILE__, __LINE__);
         psArr->nalloc = nalloc;
     }
@@ -130,5 +171,5 @@
 }
 
-void psIntArrayFree(psIntArray *restrict psArr)
+void psDoubleArrayFree(psDoubleArray *restrict psArr)
 {
     if (psArr == NULL) {
Index: /trunk/psLib/src/collections/psArray.h
===================================================================
--- /trunk/psLib/src/collections/psArray.h	(revision 485)
+++ /trunk/psLib/src/collections/psArray.h	(revision 486)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-21 00:18:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:40:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -96,10 +96,24 @@
 typedef struct
 {
-    psType type; ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
-    int nalloc;  ///< Total number of elements available.
-    int n;   ///< Number of elements in use.
-    float *arr;  ///< Array data.
+    psType type;    ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
+    int nalloc;     ///< Total number of elements available.
+    int n;          ///< Number of elements in use.
+    float *arr;     ///< Array data.
 }
 psFloatArray;
+
+/** An array of doubles.
+ *
+ * Struct for maintaining an array of double precision floating point numbers.
+ *
+ */
+typedef struct
+{
+    psType type;    ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
+    int nalloc;     ///< Total number of elements available.
+    int n;          ///< Number of elements in use.
+    double *arr;    ///< Array data.
+}
+psDoubleArray;
 
 /*****************************************************************************/
@@ -107,10 +121,19 @@
 /*****************************************************************************/
 
-/** Allocate an integer array */
+/** Allocate an integer array.
+ *
+ * Uses psLib memory allocation functions to create an array of integers as defined by the psIntArray struct. 
+ *
+ */
 psIntArray *psIntArrayAlloc(
     int nalloc  ///< Total number of elements to make available
 );
 
-/** Reallocate an integer array */
+/** Reallocate an integer array.
+ *
+ * Uses psLib memory allocation functions to reallocate an array of integers as defined by the psIntArray 
+ * struct. 
+ *
+ */
 psIntArray *psIntArrayRealloc(
     psIntArray *myArray,    ///< Array to reallocate.
@@ -119,5 +142,10 @@
 
 
-/** Deallocate an integer array */
+/** Deallocate an integer array
+ *
+ * Uses psLib memory allocation functions to deallocate an array of integers as defined by the psIntArray 
+ * struct. 
+ *
+ */
 void psIntArrayFree(
     psIntArray *restrict myArray    ///< Array to free
@@ -153,4 +181,42 @@
     psFloatArray *restrict myArray  ///< Array to free
 );
+
+/** Allocate a Double array.
+ *
+ * Uses psLib memory allocation functions to create an array of doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+psDoubleArray *psDoubleArrayAlloc(
+    int nalloc  ///< Total number of elements to make available.
+);
+
+/** Reallocate a Double array.
+ *
+ * Uses psLib memory allocation functions to reallocate an array of Doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+psDoubleArray *psDoubleArrayRealloc(
+    psDoubleArray *myArray, ///< Array to reallocate.
+    int nalloc              ///< Total number of elements to make available.
+);
+
+/** Deallocate a Double array
+ *
+ * Uses psLib memory allocation functions to deallocate an array of doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+void psDoubleArrayFree(
+    psDoubleArray *restrict myArray  ///< Array to free
+);
+
+
+
+
+
+
+
 
 /** An array of complex numbers.
@@ -182,28 +248,5 @@
 
 
-/************************************************************************************************************/
-
-/** An array of double-precision real numbers */
-typedef struct
-{
-    psType type;  ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
-    int nalloc;   ///< Total number of elements available
-    int n;    ///< Number of elements in use
-    double *arr;  ///< The array data
-}
-psDoubleArray;
-
-/** Constructor \ingroup DataGroup */
-psDoubleArray *psDoubleArrayAlloc(int nalloc) ///< Total number of elements to make available
-;
-
-/** Reallocator \ingroup DataGroup */
-psDoubleArray *psDoubleArrayRealloc(psDoubleArray *myArray, ///< Array to reallocate
-                                    int nalloc) ///< Total number of elements to make available
-;
-
-/** Destructor \ingroup DataGroup */
-void psDoubleArrayFree(psDoubleArray *restrict myArray) ///< Array to free
-;
+
 
 /** Array of pointers to void.
Index: /trunk/psLib/src/collections/psSort.c
===================================================================
--- /trunk/psLib/src/collections/psSort.c	(revision 485)
+++ /trunk/psLib/src/collections/psSort.c	(revision 486)
@@ -14,6 +14,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-21 00:18:05 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:40:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -187,5 +187,5 @@
     }
 
-    tmpFloatArray = psFloatArrayAlloc(inN, inN);
+    tmpFloatArray = psFloatArrayAlloc(inN);
     tmpFloatArray = psSort(tmpFloatArray, inArray);
 
Index: /trunk/psLib/src/types/psArray.c
===================================================================
--- /trunk/psLib/src/types/psArray.c	(revision 485)
+++ /trunk/psLib/src/types/psArray.c	(revision 486)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-21 00:18:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:40:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,5 +19,4 @@
 #include "psMemory.h"
 #include "psArray.h"
-#include "psLogMsg.h"
 
 /******************************************************************************/
@@ -54,4 +53,46 @@
 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
 /*****************************************************************************/
+
+psIntArray* psIntArrayAlloc(int nalloc)
+{
+    psIntArray *psArr = (psIntArray*)p_psAlloc(sizeof(psIntArray), __FILE__, __LINE__);
+    psArr->type.dimen = PS_DIMEN_VECTOR;
+    psArr->type.type = PS_TYPE_INT;
+    psArr->nalloc = nalloc;
+    psArr->n = 0;
+
+    if(nalloc == 0) {
+        psArr->arr = NULL;
+    } else {
+        psArr->arr = p_psAlloc(nalloc*sizeof(int), __FILE__, __LINE__);
+    }
+
+    return psArr;
+}
+
+psIntArray *psIntArrayRealloc(psIntArray *psArr, int nalloc)
+{
+    if(psArr == NULL) {
+        return psIntArrayAlloc(nalloc);
+    }
+    if(nalloc <= psArr->nalloc) {
+        if (psArr->n < nalloc) {
+            psArr->n = nalloc;
+        }
+    } else {
+        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->nalloc = nalloc;
+    }
+    return psArr;
+}
+
+void psIntArrayFree(psIntArray *restrict psArr)
+{
+    if (psArr == NULL) {
+        return;
+    }
+    p_psFree(psArr->arr, __FILE__, __LINE__);
+    p_psFree(psArr, __FILE__, __LINE__);
+}
 
 psFloatArray* psFloatArrayAlloc(int nalloc)
@@ -97,9 +138,9 @@
 }
 
-psIntArray* psIntArrayAlloc(int nalloc)
+psDoubleArray* psDoubleArrayAlloc(int nalloc)
 {
-    psIntArray *psArr = (psIntArray*)p_psAlloc(sizeof(psIntArray), __FILE__, __LINE__);
+    psDoubleArray *psArr = (psDoubleArray*)p_psAlloc(sizeof(psDoubleArray), __FILE__, __LINE__);
     psArr->type.dimen = PS_DIMEN_VECTOR;
-    psArr->type.type = PS_TYPE_INT;
+    psArr->type.type = PS_TYPE_DOUBLE;
     psArr->nalloc = nalloc;
     psArr->n = 0;
@@ -108,5 +149,5 @@
         psArr->arr = NULL;
     } else {
-        psArr->arr = p_psAlloc(nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->arr = p_psAlloc(nalloc*sizeof(double), __FILE__, __LINE__);
     }
 
@@ -114,8 +155,8 @@
 }
 
-psIntArray *psIntArrayRealloc(psIntArray *psArr, int nalloc)
+psDoubleArray *psDoubleArrayRealloc(psDoubleArray *psArr, int nalloc)
 {
     if(psArr == NULL) {
-        return psIntArrayAlloc(nalloc);
+        return psDoubleArrayAlloc(nalloc);
     }
     if(nalloc <= psArr->nalloc) {
@@ -124,5 +165,5 @@
         }
     } else {
-        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(int), __FILE__, __LINE__);
+        psArr->arr = p_psRealloc(psArr->arr, nalloc*sizeof(double), __FILE__, __LINE__);
         psArr->nalloc = nalloc;
     }
@@ -130,5 +171,5 @@
 }
 
-void psIntArrayFree(psIntArray *restrict psArr)
+void psDoubleArrayFree(psDoubleArray *restrict psArr)
 {
     if (psArr == NULL) {
Index: /trunk/psLib/src/types/psArray.h
===================================================================
--- /trunk/psLib/src/types/psArray.h	(revision 485)
+++ /trunk/psLib/src/types/psArray.h	(revision 486)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-04-21 00:18:05 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-04-21 00:40:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -96,10 +96,24 @@
 typedef struct
 {
-    psType type; ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
-    int nalloc;  ///< Total number of elements available.
-    int n;   ///< Number of elements in use.
-    float *arr;  ///< Array data.
+    psType type;    ///< Type of data. THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
+    int nalloc;     ///< Total number of elements available.
+    int n;          ///< Number of elements in use.
+    float *arr;     ///< Array data.
 }
 psFloatArray;
+
+/** An array of doubles.
+ *
+ * Struct for maintaining an array of double precision floating point numbers.
+ *
+ */
+typedef struct
+{
+    psType type;    ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
+    int nalloc;     ///< Total number of elements available.
+    int n;          ///< Number of elements in use.
+    double *arr;    ///< Array data.
+}
+psDoubleArray;
 
 /*****************************************************************************/
@@ -107,10 +121,19 @@
 /*****************************************************************************/
 
-/** Allocate an integer array */
+/** Allocate an integer array.
+ *
+ * Uses psLib memory allocation functions to create an array of integers as defined by the psIntArray struct. 
+ *
+ */
 psIntArray *psIntArrayAlloc(
     int nalloc  ///< Total number of elements to make available
 );
 
-/** Reallocate an integer array */
+/** Reallocate an integer array.
+ *
+ * Uses psLib memory allocation functions to reallocate an array of integers as defined by the psIntArray 
+ * struct. 
+ *
+ */
 psIntArray *psIntArrayRealloc(
     psIntArray *myArray,    ///< Array to reallocate.
@@ -119,5 +142,10 @@
 
 
-/** Deallocate an integer array */
+/** Deallocate an integer array
+ *
+ * Uses psLib memory allocation functions to deallocate an array of integers as defined by the psIntArray 
+ * struct. 
+ *
+ */
 void psIntArrayFree(
     psIntArray *restrict myArray    ///< Array to free
@@ -153,4 +181,42 @@
     psFloatArray *restrict myArray  ///< Array to free
 );
+
+/** Allocate a Double array.
+ *
+ * Uses psLib memory allocation functions to create an array of doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+psDoubleArray *psDoubleArrayAlloc(
+    int nalloc  ///< Total number of elements to make available.
+);
+
+/** Reallocate a Double array.
+ *
+ * Uses psLib memory allocation functions to reallocate an array of Doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+psDoubleArray *psDoubleArrayRealloc(
+    psDoubleArray *myArray, ///< Array to reallocate.
+    int nalloc              ///< Total number of elements to make available.
+);
+
+/** Deallocate a Double array
+ *
+ * Uses psLib memory allocation functions to deallocate an array of doubles as defined by the psDoubleArray 
+ * struct. 
+ *
+ */
+void psDoubleArrayFree(
+    psDoubleArray *restrict myArray  ///< Array to free
+);
+
+
+
+
+
+
+
 
 /** An array of complex numbers.
@@ -182,28 +248,5 @@
 
 
-/************************************************************************************************************/
-
-/** An array of double-precision real numbers */
-typedef struct
-{
-    psType type;  ///< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
-    int nalloc;   ///< Total number of elements available
-    int n;    ///< Number of elements in use
-    double *arr;  ///< The array data
-}
-psDoubleArray;
-
-/** Constructor \ingroup DataGroup */
-psDoubleArray *psDoubleArrayAlloc(int nalloc) ///< Total number of elements to make available
-;
-
-/** Reallocator \ingroup DataGroup */
-psDoubleArray *psDoubleArrayRealloc(psDoubleArray *myArray, ///< Array to reallocate
-                                    int nalloc) ///< Total number of elements to make available
-;
-
-/** Destructor \ingroup DataGroup */
-void psDoubleArrayFree(psDoubleArray *restrict myArray) ///< Array to free
-;
+
 
 /** Array of pointers to void.
