Index: trunk/psLib/src/math/psMatrix.c
===================================================================
--- trunk/psLib/src/math/psMatrix.c	(revision 807)
+++ trunk/psLib/src/math/psMatrix.c	(revision 824)
@@ -20,6 +20,6 @@
  *  @author Ross Harman, MHPCC
  *   
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-05-28 20:52:41 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-01 22:42:57 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -69,73 +69,73 @@
 
 /** Preprocessor macro to generate error a NULL image */
-#define PS_CHECK_NULL_VECTOR(NAME, RETURN)                                                                    \
-if (NAME == NULL || NAME->vec.v == NULL) {                                                                \
-    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME);                                \
-    return RETURN;                                                                                        \
+#define PS_CHECK_NULL_VECTOR(NAME, RETURN)                                                          \
+if (NAME == NULL || NAME->vec.v == NULL) {                                                          \
+    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME);                          \
+    return RETURN;                                                                                  \
 }
 
 /** Preprocessor macro to create vector based on another */
-#define PS_CHECK_ALLOC_VECTOR(NAME, SIZE, PS_TYPE)                                                            \
-if(NAME == NULL) {                                                                                        \
-    NAME = psVectorAlloc(PS_TYPE, SIZE);                                                                  \
+#define PS_CHECK_ALLOC_VECTOR(NAME, SIZE, PS_TYPE)                                                  \
+if(NAME == NULL) {                                                                                  \
+    NAME = psVectorAlloc(PS_TYPE, SIZE);                                                            \
 }
 
 /** Preprocessor macro to generate error for zero length vector */
-#define PS_CHECK_SIZE_VECTOR(NAME, RETURN)                                                                    \
-if (NAME->n < 1) {                                                                                        \
-    psError(__func__,"Invalid operation: %s has zero n value.", #NAME);                                   \
-    return RETURN;                                                                                        \
+#define PS_CHECK_SIZE_VECTOR(NAME, RETURN)                                                          \
+if (NAME->n < 1) {                                                                                  \
+    psError(__func__,"Invalid operation: %s has zero n value.", #NAME);                             \
+    return RETURN;                                                                                  \
 }
 
 /** Preprocessor macro to generate error a NULL image */
-#define PS_CHECK_NULL_IMAGE(NAME, RETURN)                                                                     \
-if (NAME == NULL || NAME->data.v == NULL) {                                                               \
-    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME);                                \
-    return RETURN;                                                                                        \
+#define PS_CHECK_NULL_IMAGE(NAME, RETURN)                                                           \
+if (NAME == NULL || NAME->data.V == NULL) {                                                         \
+    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME);                          \
+    return RETURN;                                                                                  \
 }
 
 /** Preprocessor macro to create image based on another */
-#define PS_CHECK_ALLOC_IMAGE(NAME, NCOLS, NROWS, PS_TYPE)                                                    \
-if(NAME == NULL) {                                                                                       \
-    NAME = psImageAlloc(NCOLS, NROWS, PS_TYPE);                                                          \
+#define PS_CHECK_ALLOC_IMAGE(NAME, NCOLS, NROWS, PS_TYPE)                                           \
+if(NAME == NULL) {                                                                                  \
+    NAME = psImageAlloc(NCOLS, NROWS, PS_TYPE);                                                     \
 }
 
 /** Preprocessor macro to generate error for zero length rows or columns */
-#define PS_CHECK_SIZE_IMAGE(NAME, RETURN)                                                                     \
-if (NAME->numCols < 1 || NAME->numRows < 1) {                                                             \
-    psError(__func__,"Invalid operation: %s has zero rows or columns (%dx%d).", #NAME,                    \
-            NAME->numCols, NAME->numRows);                                                                        \
-    return RETURN;                                                                                        \
+#define PS_CHECK_SIZE_IMAGE(NAME, RETURN)                                                           \
+if (NAME->numCols < 1 || NAME->numRows < 1) {                                                       \
+    psError(__func__,"Invalid operation: %s has zero rows or columns (%dx%d).", #NAME,                 \
+            NAME->numCols, NAME->numRows);                                                                 \
+    return RETURN;                                                                                     \
 }
 
 /** Preprocessor macro to generate error for image dimensionality not set to PS_DIMEN_IMAGE */
-#define PS_CHECK_DIMEN_AND_TYPE(NAME, PS_DIMEN, RETURN)                                                       \
-if (NAME->type.dimen != PS_DIMEN) {                                                                       \
-    psError(__func__,"Invalid operation: %s incorrect dimensionality %d.", #NAME, PS_DIMEN);              \
-    return RETURN;                                                                                        \
-} else if(NAME->type.type != PS_TYPE_F64) {                                                               \
-    psError(__func__, "Invalid operation: %s not PS_TYPE_F64.", #NAME);                                   \
-    return RETURN;                                                                                        \
+#define PS_CHECK_DIMEN_AND_TYPE(NAME, PS_DIMEN, RETURN)                                             \
+if (NAME->type.dimen != PS_DIMEN) {                                                                 \
+    psError(__func__,"Invalid operation: %s incorrectdimensionality %d.", #NAME, PS_DIMEN);         \
+    return RETURN;                                                                                  \
+} else if(NAME->type.type != PS_TYPE_F64) {                                                         \
+    psError(__func__, "Invalid operation: %s not PS_TYPE_F64.", #NAME);                             \
+    return RETURN;                                                                                   \
 }
 
 /** Preprocessor macro to check that input is not equal to output */
-#define PS_CHECK_POINTERS(NAME1, NAME2, RETURN)                                                               \
-if (NAME1 == NAME2) {                                                                                     \
-    psError(__func__,"Invalid operation: Pointer to %s is same as %s.", #NAME1, #NAME2);                  \
-    return RETURN;                                                                                        \
+#define PS_CHECK_POINTERS(NAME1, NAME2, RETURN)                                                     \
+if (NAME1 == NAME2) {                                                                               \
+    psError(__func__,"Invalid operation: Pointer to %s is same as %s.", #NAME1, #NAME2);            \
+    return RETURN;                                                                                  \
 }
 
 /** Preprocessor macro to check that an image is square */
-#define PS_CHECK_SQUARE(NAME, RETURN)                                                                         \
-if (NAME->numCols != NAME->numRows) {                                                                     \
-    psError(__func__,"Invalid operation: %s not square array.", #NAME);                                   \
-    return RETURN;                                                                                        \
+#define PS_CHECK_SQUARE(NAME, RETURN)                                                               \
+if (NAME->numCols != NAME->numRows) {                                                               \
+    psError(__func__,"Invalid operation: %s not square array.", #NAME);                             \
+    return RETURN;                                                                                  \
 }
 
 /** Preprocessor macro to initalize a GSL matrix. */
-#define PS_GSL_MATRIX_INITIALIZE(LHS_NAME, RHS_NAME)                                                          \
-LHS_NAME.size1 = numRows;                                                                                 \
-LHS_NAME.size2 = numCols;                                                                                 \
-LHS_NAME.tda   = numCols;                                                                                 \
+#define PS_GSL_MATRIX_INITIALIZE(LHS_NAME, RHS_NAME)                                                \
+LHS_NAME.size1 = numRows;                                                                           \
+LHS_NAME.size2 = numCols;                                                                           \
+LHS_NAME.tda   = numCols;                                                                           \
 LHS_NAME.data  = RHS_NAME;
 
@@ -174,5 +174,5 @@
     outPerm->n = numCols;
     perm.data = outPerm->vec.v;
-    PS_GSL_MATRIX_INITIALIZE(lu, outImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(lu, outImage->data.V[0]);
 
     // Non-square matrices not allowed
@@ -181,5 +181,5 @@
 
     // Copy psImage input data into GSL matrix data to keep input data pristine
-    memcpy(lu.data, inImage->data.v[0], arraySize);
+    memcpy(lu.data, inImage->data.V[0], arraySize);
 
     // Calculate LU decomposition
@@ -189,5 +189,6 @@
 }
 
-psVector *psMatrixLUSolve(psVector *outVector, const psImage *inImage, const psVector *inVector, const psVector *inPerm)
+psVector *psMatrixLUSolve(psVector *outVector, const psImage *inImage, const psVector *inVector, const
+                          psVector *inPerm)
 {
     int arraySize = 0;
@@ -220,5 +221,5 @@
 
     // Initialize GSL data
-    PS_GSL_MATRIX_INITIALIZE(lu, inImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(lu, inImage->data.V[0]);
 
     outVector->n = numCols;
@@ -270,5 +271,5 @@
 
     // Initialize GSL data
-    PS_GSL_MATRIX_INITIALIZE(inv, outImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(inv, outImage->data.V[0]);
 
     // Non-square matrices not allowed
@@ -277,5 +278,5 @@
 
     // Copy psImage input data into GSL matrix data to keep input data pristine
-    memcpy(lu->data, inImage->data.v[0], arraySize);
+    memcpy(lu->data, inImage->data.V[0], arraySize);
 
     // Invert data and calculate determinant
@@ -319,5 +320,5 @@
 
     // Copy psImage input data into GSL matrix data to keep input data pristine
-    memcpy(lu->data, inImage->data.v[0], arraySize);
+    memcpy(lu->data, inImage->data.V[0], arraySize);
 
     // Calculate determinant
@@ -360,7 +361,7 @@
 
     // Initialize GSL data
-    PS_GSL_MATRIX_INITIALIZE(m1, inImage1->data.v[0]);
-    PS_GSL_MATRIX_INITIALIZE(m2, inImage2->data.v[0]);
-    PS_GSL_MATRIX_INITIALIZE(m3, outImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(m1, inImage1->data.V[0]);
+    PS_GSL_MATRIX_INITIALIZE(m2, inImage2->data.V[0]);
+    PS_GSL_MATRIX_INITIALIZE(m3, outImage->data.V[0]);
 
     // Non-square matrices not allowed
@@ -396,5 +397,5 @@
 
     // Initialize GSL data
-    PS_GSL_MATRIX_INITIALIZE(trans, outImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(trans, outImage->data.V[0]);
 
     // Non-square matrices not allowed
@@ -403,5 +404,5 @@
 
     // Copy psImage input data into psImage output data to keep input data pristine
-    memcpy(outImage->data.v[0], inImage->data.v[0], arraySize);
+    memcpy(outImage->data.V[0], inImage->data.V[0], arraySize);
 
     // Transpose data
@@ -434,6 +435,6 @@
 
     // Initialize GSL data
-    PS_GSL_MATRIX_INITIALIZE(in, inImage->data.v[0]);
-    PS_GSL_MATRIX_INITIALIZE(out, outImage->data.v[0]);
+    PS_GSL_MATRIX_INITIALIZE(in, inImage->data.V[0]);
+    PS_GSL_MATRIX_INITIALIZE(out, outImage->data.V[0]);
 
     // Allocate GSL structs
@@ -482,5 +483,5 @@
 
     colSize = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numRows;
-    memcpy(outVector->vec.v, inImage->data.v[0], colSize);
+    memcpy(outVector->vec.v, inImage->data.V[0], colSize);
 
     return outVector;
@@ -509,5 +510,5 @@
 
     colSize = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numRows;
-    memcpy(outImage->data.v[0], inVector->vec.v, colSize);
+    memcpy(outImage->data.V[0], inVector->vec.v, colSize);
 
     return outImage;
