Index: trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
===================================================================
--- trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c	(revision 1246)
+++ trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c	(revision 1385)
@@ -29,6 +29,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-21 00:09:11 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -445,9 +445,10 @@
             psError(__func__, ": Line %d - Vector contains zero elements");
         }
-    } else if(dim1 == PS_DIMEN_IMAGE) {
-        if(((psImage*)in1)->numCols==0 || ((psImage*)in1)->numRows==0) {
-            psError(__func__, ": Line %d - Image contains zero length row or cols");
+    } else
+        if(dim1 == PS_DIMEN_IMAGE) {
+            if(((psImage*)in1)->numCols==0 || ((psImage*)in1)->numRows==0) {
+                psError(__func__, ": Line %d - Image contains zero length row or cols");
+            }
         }
-    }
 
     if(dim2 == PS_DIMEN_VECTOR) {
@@ -455,43 +456,52 @@
             psError(__func__, ": Line %d - Vector contains zero elements");
         }
-    } else if(dim2 == PS_DIMEN_IMAGE) {
-        if(((psImage*)in2)->numCols==0 || ((psImage*)in2)->numRows==0) {
-            psError(__func__, ": Line %d - Image contains zero length row or cols");
+    } else
+        if(dim2 == PS_DIMEN_IMAGE) {
+            if(((psImage*)in2)->numCols==0 || ((psImage*)in2)->numRows==0) {
+                psError(__func__, ": Line %d - Image contains zero length row or cols");
+            }
         }
-    }
 
     if(dim1 == PS_DIMEN_SCALAR) {
         if(dim2 == PS_DIMEN_SCALAR) {
             BINARY_OP(SCALAR,SCALAR,out,psType1,op,psType2);               // scalar op scalar
-        } else if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
-            BINARY_OP(SCALAR,VECTOR,out,psType1,op,psType2);               // scalar op vector
-        } else if(dim2 == PS_DIMEN_IMAGE) {
-            BINARY_OP(SCALAR,IMAGE,out,psType1,op,psType2);                // scalar op image
-        } else {
-            psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
-        }
-    } else if(dim1==PS_DIMEN_VECTOR || dim1==PS_DIMEN_TRANSV) {
-        if(dim2 == PS_DIMEN_SCALAR) {
-            BINARY_OP(VECTOR,SCALAR,out,psType1,op,psType2);               // vector op scalar
-        } else if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
-            BINARY_OP(VECTOR,VECTOR,out,psType1,op,psType2);               // vector op vector
-        } else if(dim2 == PS_DIMEN_IMAGE) {
-            BINARY_OP(VECTOR,IMAGE,out,psType1,op,psType2);                // vector op image
-        } else {
-            psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
-        }
-    } else if(dim1 == PS_DIMEN_IMAGE) {
-        if(dim2 == PS_DIMEN_SCALAR) {
-            BINARY_OP(IMAGE,SCALAR,out,psType1,op,psType2);                // image op scalar
-        } else if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
-            BINARY_OP(IMAGE,VECTOR,out,psType1,op,psType2);                // image op vector
-        } else if(dim2 == PS_DIMEN_IMAGE) {
-            BINARY_OP(IMAGE,IMAGE,out,psType1,op,psType2);                 // image op image
-        } else {
-            psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
-        }
-    } else {
-        psError(__func__, ": Line %d - Invalid dimensionality for in1 arg: %d", __LINE__, dim1);
-    }
+        } else
+            if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
+                BINARY_OP(SCALAR,VECTOR,out,psType1,op,psType2);               // scalar op vector
+            } else
+                if(dim2 == PS_DIMEN_IMAGE) {
+                    BINARY_OP(SCALAR,IMAGE,out,psType1,op,psType2);                // scalar op image
+                } else {
+                    psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
+                }
+    } else
+        if(dim1==PS_DIMEN_VECTOR || dim1==PS_DIMEN_TRANSV) {
+            if(dim2 == PS_DIMEN_SCALAR) {
+                BINARY_OP(VECTOR,SCALAR,out,psType1,op,psType2);               // vector op scalar
+            } else
+                if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
+                    BINARY_OP(VECTOR,VECTOR,out,psType1,op,psType2);               // vector op vector
+                } else
+                    if(dim2 == PS_DIMEN_IMAGE) {
+                        BINARY_OP(VECTOR,IMAGE,out,psType1,op,psType2);                // vector op image
+                    } else {
+                        psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
+                    }
+        } else
+            if(dim1 == PS_DIMEN_IMAGE) {
+                if(dim2 == PS_DIMEN_SCALAR) {
+                    BINARY_OP(IMAGE,SCALAR,out,psType1,op,psType2);                // image op scalar
+                } else
+                    if(dim2==PS_DIMEN_VECTOR || dim2==PS_DIMEN_TRANSV) {
+                        BINARY_OP(IMAGE,VECTOR,out,psType1,op,psType2);                // image op vector
+                    } else
+                        if(dim2 == PS_DIMEN_IMAGE) {
+                            BINARY_OP(IMAGE,IMAGE,out,psType1,op,psType2);                 // image op image
+                        } else {
+                            psError(__func__, ": Line %d - Invalid dimensionality for in2 arg: %d", __LINE__, dim2);
+                        }
+            } else {
+                psError(__func__, ": Line %d - Invalid dimensionality for in1 arg: %d", __LINE__, dim1);
+            }
 
     return out;
@@ -748,9 +758,10 @@
             psError(__func__, ": Line %d - Vector contains zero elements");
         }
-    } else if(dimIn == PS_DIMEN_IMAGE) {
-        if(((psImage*)in)->numCols==0 || ((psImage*)in)->numRows==0) {
-            psError(__func__, ": Line %d - Image contains zero length row or cols");
+    } else
+        if(dimIn == PS_DIMEN_IMAGE) {
+            if(((psImage*)in)->numCols==0 || ((psImage*)in)->numRows==0) {
+                psError(__func__, ": Line %d - Image contains zero length row or cols");
+            }
         }
-    }
 
     if(dimOut == PS_DIMEN_VECTOR) {
@@ -758,19 +769,22 @@
             psError(__func__, ": Line %d - Vector contains zero elements");
         }
-    } else if(dimOut == PS_DIMEN_IMAGE) {
-        if(((psImage*)out)->numCols==0 || ((psImage*)out)->numRows==0) {
-            psError(__func__, ": Line %d - Image contains zero length row or cols");
+    } else
+        if(dimOut == PS_DIMEN_IMAGE) {
+            if(((psImage*)out)->numCols==0 || ((psImage*)out)->numRows==0) {
+                psError(__func__, ": Line %d - Image contains zero length row or cols");
+            }
         }
-    }
 
     if(dimIn == PS_DIMEN_SCALAR) {
         UNARY_OP(SCALAR,out,psTypeIn,op);                                 // scalar
-    } else if(dimIn==PS_DIMEN_VECTOR || dimIn==PS_DIMEN_TRANSV) {
-        UNARY_OP(VECTOR,out,psTypeIn,op);                                 // vector
-    } else if(dimIn == PS_DIMEN_IMAGE) {
-        UNARY_OP(IMAGE,out,psTypeIn,op);                                  // image
-    } else {
-        psError(__func__, ": Line %d - Invalid dimensionality for in arg: %d", __LINE__, dimIn);
-    }
+    } else
+        if(dimIn==PS_DIMEN_VECTOR || dimIn==PS_DIMEN_TRANSV) {
+            UNARY_OP(VECTOR,out,psTypeIn,op);                                 // vector
+        } else
+            if(dimIn == PS_DIMEN_IMAGE) {
+                UNARY_OP(IMAGE,out,psTypeIn,op);                                  // image
+            } else {
+                psError(__func__, ": Line %d - Invalid dimensionality for in arg: %d", __LINE__, dimIn);
+            }
 
     return out;
