Index: /trunk/psLib/src/collections/psVector.c
===================================================================
--- /trunk/psLib/src/collections/psVector.c	(revision 1819)
+++ /trunk/psLib/src/collections/psVector.c	(revision 1820)
@@ -10,6 +10,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-09-14 20:01:52 $
+*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-09-16 23:47:43 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -88,24 +88,22 @@
 }
 
-psVector* psVectorRecycle(psVector* restrict in, unsigned int nalloc, psElemType type)
-{
-    psElemType elemType;
+psVector* psVectorRecycle(psVector* restrict in, unsigned int n, psElemType type)
+{
+    int byteSize;
 
     if (in == NULL) {
-        return psVectorAlloc(nalloc, type);
-    }
-
-    elemType = in->type.type;
-
-    if (in->nalloc == nalloc && elemType == type) {
-        // it is proper size/type already
-        return in;
-    }
-
-    in->data.V = psRealloc(in->data.V, nalloc * PSELEMTYPE_SIZEOF(type));
+        return psVectorAlloc(n, type);
+    }
+
+    byteSize = n * PSELEMTYPE_SIZEOF(type);
+
+    // need to increase data buffer?
+    if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
+        in->data.V = psRealloc(in->data.V, byteSize);
+        in->nalloc = n;
+    }
 
     in->type.type = type;
-    in->nalloc = nalloc;
-    in->n = nalloc;
+    in->n = n;
 
     return in;
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 1819)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 1820)
@@ -10,6 +10,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-09-14 20:01:52 $
+*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-09-16 23:47:43 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -88,24 +88,22 @@
 }
 
-psVector* psVectorRecycle(psVector* restrict in, unsigned int nalloc, psElemType type)
-{
-    psElemType elemType;
+psVector* psVectorRecycle(psVector* restrict in, unsigned int n, psElemType type)
+{
+    int byteSize;
 
     if (in == NULL) {
-        return psVectorAlloc(nalloc, type);
-    }
-
-    elemType = in->type.type;
-
-    if (in->nalloc == nalloc && elemType == type) {
-        // it is proper size/type already
-        return in;
-    }
-
-    in->data.V = psRealloc(in->data.V, nalloc * PSELEMTYPE_SIZEOF(type));
+        return psVectorAlloc(n, type);
+    }
+
+    byteSize = n * PSELEMTYPE_SIZEOF(type);
+
+    // need to increase data buffer?
+    if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) {
+        in->data.V = psRealloc(in->data.V, byteSize);
+        in->nalloc = n;
+    }
 
     in->type.type = type;
-    in->nalloc = nalloc;
-    in->n = nalloc;
+    in->n = n;
 
     return in;
