Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 4820)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 4821)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-22 22:18:23 $
+*  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-08-19 21:27:43 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -607,2 +607,129 @@
     return (true);
 }
+
+
+bool psVectorInit(psVector *image,
+                  ...)
+{
+
+    va_list argp;
+    psU8  vU8;
+    psU16 vU16;
+    psU32 vU32;
+    psU64 vU64;
+    psS8 vS8;
+    psS16 vS16;
+    psS32 vS32;
+    psS64 vS64;
+    psF32 vF32;
+    psF64 vF64;
+    psC32 vC32;
+    psC64 vC64;
+
+    if (image == NULL)
+        return (false);
+
+    va_start (argp, image);
+
+    switch (image->type.type) {
+    case PS_TYPE_U8:
+        vU8 = va_arg (argp, psU32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            //            for (int ix = 0; ix < image->numCols; ix++) {
+            image->data.U8[iy] = vU8;
+            //            }
+        }
+        break;
+
+    case PS_TYPE_F32:
+        vF32 = va_arg (argp, psF64);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            //           for (int ix = 0; ix < image->numCols; ix++) {
+            image->data.F32[iy] = vF32;
+            //            }
+        }
+        return (true);
+
+    case PS_TYPE_F64:
+        vF64 = va_arg (argp, psF64);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            //            for (int ix = 0; ix < image->numCols; ix++) {
+            image->data.F64[iy] = vF64;
+            //            }
+        }
+        return (true);
+    case PS_TYPE_U16:
+        vU16 = va_arg (argp, psU32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.U16[iy] = vU16;
+        }
+        return (true);
+    case PS_TYPE_U32:
+        vU32 = va_arg (argp, psU32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.U32[iy] = vU32;
+        }
+        return (true);
+    case PS_TYPE_U64:
+        vU64 = va_arg (argp, psU64);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.U64[iy] = vU64;
+        }
+        return (true);
+    case PS_TYPE_S8:
+        vS8 = va_arg (argp, psS32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.S8[iy] = vS8;
+        }
+        return (true);
+    case PS_TYPE_S16:
+        vS16 = va_arg (argp, psS32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.S16[iy] = vS16;
+        }
+        return (true);
+    case PS_TYPE_S32:
+        vS32 = va_arg (argp, psS32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.S32[iy] = vS32;
+        }
+        return (true);
+    case PS_TYPE_S64:
+        vS64 = va_arg (argp, psS64);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.S64[iy] = vS64;
+        }
+        return (true);
+    case PS_TYPE_C32:
+        vC32 = va_arg (argp, psC32);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.C32[iy] = vC32;
+        }
+        return (true);
+    case PS_TYPE_C64:
+        vC64 = va_arg (argp, psC64);
+
+        for (long iy = 0; iy < image->n; iy++) {
+            image->data.C64[iy] = vC64;
+        }
+        return (true);
+
+    default:
+        psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", image->type);
+        return (false);
+    }
+    return (false);
+}
+
+
Index: /trunk/psLib/src/mathtypes/psVector.h
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.h	(revision 4820)
+++ /trunk/psLib/src/mathtypes/psVector.h	(revision 4821)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-22 22:18:18 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-08-19 21:27:43 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -206,4 +206,15 @@
 );
 
+/** Initializes the vector with the given value.
+ *
+ *  The input data is cast to match the vector datatype, allowing for integers to be preserved.
+ *
+ *  @return bool:       True if successful, otherwise false.
+ */
+bool psVectorInit(
+    psVector *image,                   ///< the vector to be initialized
+    ...                                ///< Variable argument list for initialization
+);
+
 /// @}
 
