Index: /trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- /trunk/psLib/src/imageops/psImageConvolve.c	(revision 7070)
+++ /trunk/psLib/src/imageops/psImageConvolve.c	(revision 7071)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-21 20:45:56 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-05 02:48:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -603,4 +603,5 @@
         /* generate normalized gaussian */ \
         psVector *gaussnorm = psVectorAlloc (Npixel, PS_TYPE_##TYPE); \
+        gaussnorm->n = gaussnorm->nalloc; \
         sum = 0.0; \
         for (int i = -Nrange; i < Nrange + 1; i++) { \
@@ -615,4 +616,5 @@
         /* smooth in X direction */ \
         temp = psVectorAlloc (Nx, PS_TYPE_##TYPE); \
+        temp->n = temp->nalloc; \
         for (int j = 0; j < Ny; j++) { \
             ps##TYPE *vi = image->data.TYPE[j]; \
@@ -661,4 +663,5 @@
         for (int j = 0; j < Nrange; j++) { \
             temp = psVectorAlloc (Nx, PS_TYPE_##TYPE); \
+            temp->n = temp->nalloc; \
             /* zero the output row */ \
             memset (temp->data.TYPE, 0, Nx*sizeof(PS_TYPE_##TYPE)); \
Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 7070)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 7071)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.103 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-20 01:13:11 $
+ *  @version $Revision: 1.104 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-05 02:48:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -714,6 +714,8 @@
 
     char buffer[20];
-    for (int j = 0; j < a[0].numRows; j++) {
-        for (int i = 0; i < a[0].numCols; i++) {
+    //    for (int j = 0; j < a[0].numRows; j++) {
+    //        for (int i = 0; i < a[0].numCols; i++) {
+    for (int j = 0; j < a->numRows; j++) {
+        for (int i = 0; i < a->numCols; i++) {
             snprintf (buffer,20, "%f  ", p_psImageGetElementF64(a, i, j));
             write(fd,buffer,strlen(buffer));
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 7070)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 7071)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-05-04 00:09:11 $
+*  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-05-05 02:48:34 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -207,5 +207,5 @@
     output = psVectorRecycle(output, nElements, type);
     if (nElements == 0) {
-        psWarning("Warning: psVector was copied with 0 elements!\n");
+        //        psWarning("Warning: psVector was copied with 0 elements!\n");
         return output;
     }
Index: /trunk/psLib/test/imageops/tst_psImageSmooth.c
===================================================================
--- /trunk/psLib/test/imageops/tst_psImageSmooth.c	(revision 7070)
+++ /trunk/psLib/test/imageops/tst_psImageSmooth.c	(revision 7071)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-01 21:35:59 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-05 02:48:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -83,5 +83,5 @@
     }
     if (VERBOSE) {
-        p_psImagePrint(1, img, "The Smmothed Image");
+        p_psImagePrint(1, img, "The Smoothed Image");
     }
 
@@ -132,5 +132,5 @@
         }
         if (VERBOSE) {
-            p_psImagePrint(1, img, "The Smmothed Image");
+            p_psImagePrint(1, img, "The Smoothed Image");
         }
 
@@ -139,5 +139,6 @@
                 for (psS32 j = 1 ; j < numCols-1 ; j++) {
                     if ((fabs(img->data.F32[i][j] - 0.5) > 0.1)) {
-                        printf("TEST ERROR: img[%d][%d] was %f, expected 0.5\n", i, j, img->data.F32[i][j]);
+                        printf("TEST ERROR: img[%d][%d] was %f, expected 0.5\n",
+                               i, j, img->data.F32[i][j]);
                         testStatus = false;
                     }
@@ -150,5 +151,6 @@
                 for (psS32 j = 1 ; j < numCols-1 ; j++) {
                     if ((fabs(img->data.F64[i][j] - 0.5) > 0.1)) {
-                        printf("TEST ERROR: img[%d][%d] was %f, expected 0.5\n", i, j, img->data.F64[i][j]);
+                        printf("TEST ERROR: img[%d][%d] was %f, expected 0.5\n",
+                               i, j, img->data.F64[i][j]);
                         testStatus = false;
                     }
@@ -161,25 +163,4 @@
     return(testStatus);
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 static psS32 testImageSmooth()
Index: /trunk/psLib/test/imageops/tst_psImageStructManip.c
===================================================================
--- /trunk/psLib/test/imageops/tst_psImageStructManip.c	(revision 7070)
+++ /trunk/psLib/test/imageops/tst_psImageStructManip.c	(revision 7071)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-13 02:47:00 $
+*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-05-05 02:48:34 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -62,9 +62,11 @@
     subset3 = psImageSubset(original,region1);
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members nrow and ncol are equal to "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure members nrow and ncol are equal to "
              "the input parameter nrow and ncol respectively.");
 
     if (subset2->numCols != c/2 || subset2->numRows != r/2) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset output size was not proper(%dx%d, should be %dx%d).",
                 subset2->numCols, subset2->numRows, c/2,r/2);
         return 1;
@@ -72,10 +74,12 @@
 
     if (subset3->numCols != c/2 || subset3->numRows != r/2) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset output size was not proper(%dx%d, should be %dx%d).",
                 subset3->numCols, subset3->numRows, c/2,r/2);
         return 2;
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure contains expected values in the "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure contains expected values in the "
              "row member, if the input psImage structure image contains known values.");
 
@@ -95,5 +99,6 @@
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member type is equal to the input "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure member type is equal to the input "
              "psImage structure member type.");
 
@@ -109,19 +114,23 @@
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members row0 and col0 are equal to "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure members row0 and col0 are equal to "
              "the input parameters row0 and col0 respectively.");
 
     if (subset2->col0 != c/4 || subset2->row0 != r/4) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).",
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't set col0/row0 for subset2 (%d/%d, should be %d/%d).",
                 subset2->col0,subset2->row0,c/4,r/4);
         return 8;
     }
     if (subset3->col0 != 0 || subset3->row0 != 0) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).",
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't set col0/row0 for subset3 (%d/%d, should be %d/%d).",
                 subset3->col0,subset3->row0,0,0);
         return 9;
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member parent is equal to the "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure member parent is equal to the "
              "input psImage structure pointer image.");
 
@@ -138,10 +147,12 @@
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the input psImage structure image only has the following members "
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the input psImage structure image only has the following members "
              "changed: 1) Nchildren is increased by one. 2) parent contains pointer psImage structure "
              "out at parent[Nchildren-1].");
 
     if (original->children == NULL || original->children->n != 2) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't increment number of children by one per subset.");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't increment number of children by one per subset.");
         return 12;
     }
@@ -180,17 +191,20 @@
     }
     if (memcmp(original,&preSubsetStruct,sizeof(psImage)) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset changed the original struct though it failed to subset.");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset changed the original struct though it failed to subset.");
         return 17;
     }
 
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure pointer is null and program "
-             "execution doesn't stop, if the input parameters row0 and col0 are not within the range of "
-             "values of psImage structure image.");
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure pointer is null and program "
+             "execution doesn't stop, if the input parameters row0 and col0 are not within "
+             "the range of values of psImage structure image.");
 
     psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
     subset1 = psImageSubset(original, psRegionSet(0,c/2, 0,r*2));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset origin was outside of "
                 "image (via cols).");
         return 18;
@@ -199,5 +213,6 @@
     subset1 = psImageSubset(original,psRegionSet(0,c*2,0,r/2));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset origin was outside of "
                 "image (via rows).");
         return 19;
@@ -206,5 +221,6 @@
     subset1 = psImageSubset(original, psRegionSet(-1,c/2,0,r/2));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset origin was outside of "
                 "image (col0=-1).");
         return 20;
@@ -213,18 +229,21 @@
     subset1 = psImageSubset(original, psRegionSet(0,c/2,-1,r/2));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset origin was outside of "
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset origin was outside of "
                 "image (row0=-1).");
         return 21;
     }
 
-    psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure pointer is null and program "
-             "execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of "
-             "data not within the input psImage structure image.  Also verify the input psImage structure "
-             "is not modified.");
+    psLogMsg(__func__,PS_LOG_INFO,
+             "Verify the returned psImage structure pointer is null and program "
+             "execution doesn't stop if the input parameters nrow, ncol, row0 and col0 "
+             "specify a range of data not within the input psImage structure image.  Also "
+             "verify the input psImage structure is not modified.");
 
     psLogMsg(__func__,PS_LOG_INFO,"An error should follow...");
     subset1 = psImageSubset(original,psRegionSet(0,c/2,0,r+1));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via rows).");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset was outside of image (via rows).");
         return 22;
     }
@@ -232,5 +251,6 @@
     subset1 = psImageSubset(original, psRegionSet(0,c+1,0,r/2));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via cols).");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset was outside of image (via cols).");
         return 23;
     }
@@ -238,9 +258,11 @@
     subset1 = psImageSubset(original,psRegionSet(0,c+1,0,r+1));
     if (subset1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageSubset didn't return NULL when subset was outside of image (via row+cols).");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageSubset didn't return NULL when subset was outside of image (via row+cols).");
         return 24;
     }
 
-    psLogMsg(__func__, PS_LOG_INFO, "psImageFreeChildren shall deallocate any children images of a "
+    psLogMsg(__func__, PS_LOG_INFO,
+             "psImageFreeChildren shall deallocate any children images of a "
              "psImage structure");
 
@@ -251,10 +273,11 @@
     // Verify the returned psImage structure member Nchildren is set to zero.
     if (original->children != NULL && original->children->n > 0) {
-        psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren didn't set number of children to zero.");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageFreeChildren didn't set number of children to zero.");
         return 25;
     }
 
-    //Verify the returned psImage structure members type, nrow, ncol, row0, col0, rows and parent are not
-    // modified.
+    //Verify the returned psImage structure members type, nrow, ncol, row0, col0, rows
+    // and parent are not modified.
     if (preSubsetStruct.numRows != original->numRows ||
             preSubsetStruct.numCols != original->numCols ||
@@ -262,5 +285,6 @@
             preSubsetStruct.col0 != original->col0) {
 
-        psError(PS_ERR_UNKNOWN,true,"psImageFreeChildren modified parent's non-children elements.");
+        psError(PS_ERR_UNKNOWN,true,
+                "psImageFreeChildren modified parent's non-children elements.");
         return 27;
     }
@@ -352,5 +376,6 @@
             } \
             if (abs(img2Row[col] - (ps##OUT)(imgRow[col])) > 0.5) { \
-                psError(PS_ERR_UNKNOWN, true,"returned psImage values after copy don't match at %d,%d " \
+                psError(PS_ERR_UNKNOWN, true, \
+                        "returned psImage values after copy don't match at %d,%d " \
                         "(%d vs %d)",\
                         col,row,img2Row[col], (ps##OUT)(imgRow[col])); \
@@ -456,5 +481,6 @@
     for (psS32 row = 0; row < image2->numRows; row++) {
         for (psS32 col = 0; col < image2->numCols; col++) {
-            if (fabsf(image2->data.F32[row][col] - image->data.F32[row+qtrR][col+qtrC]) > FLT_EPSILON) {
+            if (fabsf(image2->data.F32[row][col] - image->data.F32[row+qtrR][col+qtrC])
+                    > FLT_EPSILON) {
                 psLogMsg(__func__,PS_LOG_ERROR,
                          "The value at (%d,%d) was %g, but should be %g.",
Index: /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c
===================================================================
--- /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c	(revision 7070)
+++ /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c	(revision 7071)
@@ -12,6 +12,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-05-02 22:35:52 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-05-05 02:48:35 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -165,7 +165,13 @@
     //    }
     if (out != NULL) {
+        if (out->n != 0) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                    "psVectorSort failed to correctly return a 0-length vector.\n");
+            return 12;
+        }
+    } else {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psVectorSort failed to return a NULL vector for 0-length input vector.\n");
-        return 666;
+                "psVectorSort returned a NULL vector instead of expected vector with n=0.\n");
+        return 13;
     }
     /*    if(out->n != 0) {
@@ -174,4 +180,5 @@
         }
         */
+    psFree(out);
     printFooter(stdout,"psVectorSort","Sort zero element vector",true);
 
Index: /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr
===================================================================
--- /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr	(revision 7070)
+++ /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr	(revision 7071)
@@ -5,6 +5,2 @@
 <DATE><TIME>|<HOST>|E|psVectorSort (FILE:LINENO)
     Error in psVectorSort:  psVectorCopy returned NULL vector!
-<DATE><TIME>|<HOST>|W|psVectorCopy (FILE:LINENO)
-    Warning: psVector was copied with 0 elements!
-<DATE><TIME>|<HOST>|E|psVectorSort (FILE:LINENO)
-    Error in psVectorSort:  Vector has less than 2 data entries!
