Index: trunk/psLib/src/math/psBinaryOp.c
===================================================================
--- trunk/psLib/src/math/psBinaryOp.c	(revision 7189)
+++ trunk/psLib/src/math/psBinaryOp.c	(revision 7192)
@@ -30,6 +30,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-23 23:43:18 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-24 03:10:14 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -56,275 +56,196 @@
  *****************************************************************************/
 
-// Conversion for degrees to radians
-#define D2R 0.01745329252111111  /* PI/180 */
-
-// Conversion for radians to degrees
-#define R2D 57.29577950924861   /* 180.0/PI */
-
 // Binary SCALAR_XXXX operations
-#define SCALAR_SCALAR(OUT,IN1,OP,IN2,TYPE)                                                                   \
-{                                                                                                            \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    o  = &((psScalar* )OUT)->data.TYPE;                                                                      \
-    i1 = &((psScalar* )IN1)->data.TYPE;                                                                      \
-    i2 = &((psScalar* )IN2)->data.TYPE;                                                                      \
-    *o = OP;                                                                                                 \
-}
-
-#define SCALAR_VECTOR(OUT,IN1,OP,IN2,TYPE)                                                                   \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 npt = 0;                                                                                             \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    npt  = ((psVector* )IN2)->n;                                                                             \
-    o  = ((psVector* )OUT)->data.TYPE;                                                                       \
-    i1 = &((psScalar* )IN1)->data.TYPE;                                                                      \
-    i2 = ((psVector* )IN2)->data.TYPE;                                                                       \
-    for (i=0; i < npt; i++, o++, i2++) {                                                                     \
-        *o = OP;                                                                                             \
-    }                                                                                                        \
-}
-
-#define SCALAR_IMAGE(OUT,IN1,OP,IN2,TYPE)                                                                    \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 j = 0;                                                                                               \
-    psS32 numRows = 0;                                                                                         \
-    psS32 numCols = 0;                                                                                         \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    numRows = ((psImage* )IN2)->numRows;                                                                     \
-    numCols = ((psImage* )IN2)->numCols;                                                                     \
-    for(j = 0; j < numCols; j++) {                                                                           \
-        o  = ((psImage* )OUT)->data.TYPE[j];                                                                 \
-        i1 = &((psScalar* )IN1)->data.TYPE;                                                                  \
-        i2 = ((psImage* )IN2)->data.TYPE[j];                                                                 \
-        for(i = 0; i < numRows; i++, o++, i2++) {                                                            \
-            *o = OP;                                                                                         \
-        }                                                                                                    \
-    }                                                                                                        \
+#define SCALAR_SCALAR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    ps##TYPE *o  = &((psScalar*)OUT)->data.TYPE; \
+    ps##TYPE *i1 = &((psScalar*)IN1)->data.TYPE; \
+    ps##TYPE *i2 = &((psScalar*)IN2)->data.TYPE; \
+    *o = OP; \
+}
+
+#define SCALAR_VECTOR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long npt = ((psVector*)IN2)->n; \
+    ps##TYPE *o  = ((psVector*)OUT)->data.TYPE; \
+    ps##TYPE *i1 = &((psScalar*)IN1)->data.TYPE; \
+    ps##TYPE *i2 = ((psVector*)IN2)->data.TYPE; \
+    for (long i = 0; i < npt; i++, o++, i2++) { \
+        *o = OP; \
+    } \
+}
+
+#define SCALAR_IMAGE(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long numRows = ((psImage*)IN2)->numRows; \
+    long numCols = ((psImage*)IN2)->numCols; \
+    for (long j = 0; j < numCols; j++) { \
+        ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+        ps##TYPE *i1 = &((psScalar*)IN1)->data.TYPE; \
+        ps##TYPE *i2 = ((psImage*)IN2)->data.TYPE[j]; \
+        for (long i = 0; i < numRows; i++, o++, i2++) { \
+            *o = OP; \
+        } \
+    } \
 }
 
 // Binary VECTOR_XXXX operations
-#define VECTOR_SCALAR(OUT,IN1,OP,IN2,TYPE)                                                                   \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 n1 = 0;                                                                                              \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    n1  = ((psVector* )IN1)->n;                                                                              \
-    o  = ((psVector* )OUT)->data.TYPE;                                                                       \
-    i1 = ((psVector* )IN1)->data.TYPE;                                                                       \
-    i2 = &((psScalar* )IN2)->data.TYPE;                                                                      \
-    for (i=0; i < n1; i++, o++, i1++) {                                                                      \
-        *o = OP;                                                                                             \
-    }                                                                                                        \
-}
-
-#define VECTOR_VECTOR(OUT,IN1,OP,IN2,TYPE)                                                                   \
-{                                                                                                            \
-    psS32 i = 0;                                                                                             \
-    psS32 n1 = 0;                                                                                            \
-    psS32 n2 = 0;                                                                                            \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    n1  = ((psVector* )IN1)->n;                                                                              \
-    n2  = ((psVector* )IN2)->n;                                                                              \
-    if(n1 != n2) {                                                                                           \
-        psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                             \
-                PS_ERRORTEXT_psMatrix_COUNT_DIFFERS,                                                         \
-                n1, n2);                                                                                     \
-        if (OUT != IN1 && OUT != IN2) {                                                                      \
-            psFree(OUT);                                                                                     \
-        }                                                                                                    \
-        return NULL;                                                                                         \
-    }                                                                                                        \
-    o  = ((psVector* )OUT)->data.TYPE;                                                                       \
-    i1 = ((psVector* )IN1)->data.TYPE;                                                                       \
-    i2 = ((psVector* )IN2)->data.TYPE;                                                                       \
-    for (i=0; i < n1; i++, o++, i1++, i2++) {                                                                \
-        *o = OP;                                                                                             \
-    }                                                                                                        \
-}
-
-#define VECTOR_IMAGE(OUT,IN1,OP,IN2,TYPE)                                                                    \
-{                                                                                                            \
-    psS32 i = 0;                                                                                             \
-    psS32 j = 0;                                                                                             \
-    psS32 n1 = 0;                                                                                            \
-    psS32 numRows2 = 0;                                                                                      \
-    psS32 numCols2 = 0;                                                                                      \
-    psDimen dim1 = 0;                                                                                        \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    n1  = ((psVector* )IN1)->n;                                                                              \
-    dim1 = ((psVector* )IN1)->type.dimen;                                                                    \
-    numRows2 = ((psImage* )IN2)->numRows;                                                                    \
-    numCols2 = ((psImage* )IN2)->numCols;                                                                    \
+#define VECTOR_SCALAR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long n1  = ((psVector*)IN1)->n; \
+    ps##TYPE *o  = ((psVector*)OUT)->data.TYPE; \
+    ps##TYPE *i1 = ((psVector*)IN1)->data.TYPE; \
+    ps##TYPE *i2 = &((psScalar*)IN2)->data.TYPE; \
+    for (long i = 0; i < n1; i++, o++, i1++) { \
+        *o = OP; \
+    } \
+}
+
+#define VECTOR_VECTOR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long n1 = ((psVector*)IN1)->n; \
+    long n2 = ((psVector*)IN2)->n; \
+    if (n1 != n2) { \
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_COUNT_DIFFERS, n1, n2); \
+        if (OUT != IN1 && OUT != IN2) { \
+            psFree(OUT); \
+        } \
+        return NULL; \
+    } \
+    ps##TYPE *o  = ((psVector*)OUT)->data.TYPE; \
+    ps##TYPE *i1 = ((psVector*)IN1)->data.TYPE; \
+    ps##TYPE *i2 = ((psVector*)IN2)->data.TYPE; \
+    for (long i = 0; i < n1; i++, o++, i1++, i2++) { \
+        *o = OP; \
+    } \
+}
+
+#define VECTOR_IMAGE(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long n1 = ((psVector*)IN1)->n; \
+    long numRows2 = ((psImage*)IN2)->numRows; \
+    long numCols2 = ((psImage*)IN2)->numCols; \
     \
-    if(dim1 == PS_DIMEN_VECTOR) { /* Regular vectors */                                             \
-        if(n1!=numRows2) {                                                                                   \
-            psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                         \
-                    PS_ERRORTEXT_psMatrix_COUNT_DIFFERS,                                                           \
-                    n1, numRows2);                                                                           \
-            if (OUT != IN1 && OUT != IN2) {                                                                  \
-                psFree(OUT);                                                                                 \
-            }                                                                                                \
-            return NULL;                                                                                     \
-        }                                                                                                    \
+    if (((psVector*)IN1)->type.dimen == PS_DIMEN_VECTOR) { /* Regular vectors */ \
+        if (n1 != numRows2) { \
+            psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_COUNT_DIFFERS, n1, numRows2); \
+            if (OUT != IN1 && OUT != IN2) { \
+                psFree(OUT); \
+            } \
+            return NULL; \
+        } \
         \
-        i1 = ((psVector* )IN1)->data.TYPE;                                                                   \
-        for(j = 0; j < numRows2; j++, i1++) {                                                                \
-            o  = ((psImage* )OUT)->data.TYPE[j];                                                             \
-            i2 = ((psImage* )IN2)->data.TYPE[j];                                                             \
-            for(i = 0; i < numCols2; i++, o++, i2++) {                                                       \
-                *o = OP;                                                                                     \
-            }                                                                                                \
-        }                                                                                                    \
-    } else {  /* Transposed vectors */                                                                       \
-        if(n1!=numCols2) {                                                                                   \
-            psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                 \
-                    PS_ERRORTEXT_psMatrix_COUNT_DIFFERS,                                                     \
-                    n1, numCols2);                       \
-            if (OUT != IN1 && OUT != IN2) {                                                                  \
-                psFree(OUT);                                                                                 \
-            }                                                                                                \
-            return NULL;                                                                                     \
-        }                                                                                                    \
+        ps##TYPE *i1 = ((psVector*)IN1)->data.TYPE; \
+        for (long j = 0; j < numRows2; j++, i1++) { \
+            ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+            ps##TYPE *i2 = ((psImage*)IN2)->data.TYPE[j]; \
+            for (long i = 0; i < numCols2; i++, o++, i2++) { \
+                *o = OP; \
+            } \
+        } \
+    } else {  /* Transposed vectors */ \
+        if (n1 != numCols2) { \
+            psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_COUNT_DIFFERS, n1, numCols2); \
+            if (OUT != IN1 && OUT != IN2) { \
+                psFree(OUT); \
+            } \
+            return NULL; \
+        } \
         \
-        for(j = 0; j < numRows2; j++) {                                                                      \
-            o  = ((psImage* )OUT)->data.TYPE[j];                                                             \
-            i1 = ((psVector* )IN1)->data.TYPE;                                                               \
-            i2 = ((psImage* )IN2)->data.TYPE[j];                                                             \
-            for(i = 0; i < numCols2; i++, o++, i1++, i2++) {                                                 \
-                *o = OP;                                                                                     \
-            }                                                                                                \
-        }                                                                                                    \
-    }                                                                                                        \
+        for (long j = 0; j < numRows2; j++) { \
+            ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+            ps##TYPE *i1 = ((psVector*)IN1)->data.TYPE; \
+            ps##TYPE *i2 = ((psImage*)IN2)->data.TYPE[j]; \
+            for (long i = 0; i < numCols2; i++, o++, i1++, i2++) { \
+                *o = OP; \
+            } \
+        } \
+    } \
 }
 
 // Binary IMAGE_XXXX operations
-#define IMAGE_SCALAR(OUT,IN1,OP,IN2,TYPE)                                                                    \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 j = 0;                                                                                               \
-    psS32 numRows = 0;                                                                                         \
-    psS32 numCols = 0;                                                                                         \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    numRows = ((psImage* )IN1)->numRows;                                                                     \
-    numCols = ((psImage* )IN1)->numCols;                                                                     \
-    for(j = 0; j < numRows; j++) {                                                                           \
-        o  = ((psImage* )OUT)->data.TYPE[j];                                                                 \
-        i1 = ((psImage* )IN1)->data.TYPE[j];                                                                 \
-        i2 = &((psScalar* )IN2)->data.TYPE;                                                                  \
-        for(i = 0; i < numCols; i++, o++, i1++) {                                                            \
-            *o = OP;                                                                                         \
-        }                                                                                                    \
-    }                                                                                                        \
-}
-
-#define IMAGE_VECTOR(OUT,IN1,OP,IN2,TYPE)                                                                    \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 j = 0;                                                                                               \
-    psS32 n2 = 0;                                                                                              \
-    psS32 numRows1 = 0;                                                                                        \
-    psS32 numCols1 = 0;                                                                                        \
-    psDimen dim2 = 0;                                                                                        \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    n2  = ((psVector* )IN2)->n;                                                                              \
-    dim2 = ((psVector* )IN2)->type.dimen;                                                                    \
-    numRows1 = ((psImage* )IN1)->numRows;                                                                    \
-    numCols1 = ((psImage* )IN1)->numCols;                                                                    \
+#define IMAGE_SCALAR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long numRows = ((psImage*)IN1)->numRows; \
+    long numCols = ((psImage*)IN1)->numCols; \
+    for (long j = 0; j < numRows; j++) { \
+        ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+        ps##TYPE *i1 = ((psImage*)IN1)->data.TYPE[j]; \
+        ps##TYPE *i2 = &((psScalar*)IN2)->data.TYPE; \
+        for (long i = 0; i < numCols; i++, o++, i1++) { \
+            *o = OP; \
+        } \
+    } \
+}
+
+#define IMAGE_VECTOR(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long n2 = ((psVector*)IN2)->n; \
+    long numRows1 = ((psImage*)IN1)->numRows; \
+    long numCols1 = ((psImage*)IN1)->numCols; \
     \
-    if(dim2 == PS_DIMEN_VECTOR) { /* Regular vectors */                                             \
-        if(n2!=numRows1) {                                                                                   \
-            psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                         \
-                    PS_ERRORTEXT_psMatrix_COUNT_DIFFERS,                                                     \
-                    n2, numRows1);                                                                           \
-            if (OUT != IN1 && OUT != IN2) {                                                                  \
-                psFree(OUT);                                                                                 \
-            }                                                                                                \
-            return NULL;                                                                                     \
-        }                                                                                                    \
+    if (((psVector*)IN2)->type.dimen == PS_DIMEN_VECTOR) { /* Regular vectors */ \
+        if (n2 != numRows1) { \
+            psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_COUNT_DIFFERS, n2, numRows1); \
+            if (OUT != IN1 && OUT != IN2) { \
+                psFree(OUT); \
+            } \
+            return NULL; \
+        } \
         \
-        i2 = ((psVector* )IN2)->data.TYPE;                                                                   \
-        for(j = 0; j < numRows1; j++, i1++) {                                                                \
-            o  = ((psImage* )OUT)->data.TYPE[j];                                                             \
-            i1 = ((psImage* )IN1)->data.TYPE[j];                                                             \
-            for(i = 0; i < numCols1; i++, o++, i1++) {                                                       \
-                *o = OP;                                                                                     \
-            }                                                                                                \
-        }                                                                                                    \
-    } else {  /* Transposed vectors */                                                                       \
-        if(n2!=numCols1) {                                                                                   \
-            psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                         \
-                    PS_ERRORTEXT_psMatrix_COUNT_DIFFERS,                                                     \
-                    n2, numCols1);                                                                           \
-            if (OUT != IN1) {                                                                                \
-                psFree(OUT);                                                                                 \
-            }                                                                                                \
-            return NULL;                                                                                     \
-        }                                                                                                    \
+        ps##TYPE *i2 = ((psVector* )IN2)->data.TYPE; \
+        for (long j = 0; j < numRows1; j++, i2++) { \
+            ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+            ps##TYPE *i1 = ((psImage*)IN1)->data.TYPE[j]; \
+            for (long i = 0; i < numCols1; i++, o++, i1++) { \
+                *o = OP; \
+            } \
+        } \
+    } else {  /* Transposed vectors */ \
+        if (n2 != numCols1) { \
+            psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_COUNT_DIFFERS, n2, numCols1); \
+            if (OUT != IN1) { \
+                psFree(OUT); \
+            } \
+            return NULL; \
+        } \
         \
-        for(j = 0; j < numRows1; j++) {                                                                      \
-            o  = ((psImage* )OUT)->data.TYPE[j];                                                             \
-            i1 = ((psVector* )IN2)->data.TYPE;                                                               \
-            i2 = ((psImage* )IN1)->data.TYPE[j];                                                             \
-            for(i = 0; i < numCols1; i++, o++, i2++, i1++) {                                                 \
-                *o = OP;                                                                                     \
-            }                                                                                                \
-        }                                                                                                    \
-    }                                                                                                        \
-}
-
-#define IMAGE_IMAGE(OUT,IN1,OP,IN2,TYPE)                                                                     \
-{                                                                                                            \
-    psS32 i = 0;                                                                                               \
-    psS32 j = 0;                                                                                               \
-    psS32 numRows1 = 0;                                                                                        \
-    psS32 numCols1 = 0;                                                                                        \
-    psS32 numRows2 = 0;                                                                                        \
-    psS32 numCols2 = 0;                                                                                        \
-    ps##TYPE *o = NULL;                                                                                      \
-    ps##TYPE *i1 = NULL;                                                                                     \
-    ps##TYPE *i2 = NULL;                                                                                     \
-    numRows1 = ((psImage* )IN1)->numRows;                                                                    \
-    numCols1 = ((psImage* )IN1)->numCols;                                                                    \
-    numRows2 = ((psImage* )IN2)->numRows;                                                                    \
-    numCols2 = ((psImage* )IN2)->numCols;                                                                    \
-    if(numRows1!=numRows2 || numCols1!=numCols2) {                                                           \
-        psError(PS_ERR_BAD_PARAMETER_SIZE, true,                                                             \
-                PS_ERRORTEXT_psMatrix_IMAGE_SIZE_DIFFERS,                                                     \
-                numCols1, numRows1, numCols2, numRows2);                                                     \
-        if (OUT != IN1 && OUT != IN2) {                                                                      \
-            psFree(OUT);                                                                                     \
-        }                                                                                                    \
-        return NULL;                                                                                         \
-    }                                                                                                        \
-    for(j = 0; j < numRows1; j++) {                                                                          \
-        o  = ((psImage* )OUT)->data.TYPE[j];                                                                 \
-        i1 = ((psImage* )IN1)->data.TYPE[j];                                                                 \
-        i2 = ((psImage* )IN2)->data.TYPE[j];                                                                 \
-        for(i = 0; i < numCols1; i++, o++, i1++, i2++) {                                                     \
-            *o = OP;                                                                                         \
-        }                                                                                                    \
-    }                                                                                                        \
-}
-
-
-// Preprocessor macro function to create arithmetic function based on input type for integers only
+        for (long j = 0; j < numRows1; j++) { \
+            ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+            ps##TYPE *i1 = ((psVector*)IN2)->data.TYPE; \
+            ps##TYPE *i2 = ((psImage*)IN1)->data.TYPE[j]; \
+            for (long i = 0; i < numCols1; i++, o++, i2++, i1++) { \
+                *o = OP; \
+            } \
+        } \
+    } \
+}
+
+#define IMAGE_IMAGE(OUT,IN1,OP,IN2,TYPE) \
+{ \
+    long numRows1 = ((psImage*)IN1)->numRows; \
+    long numCols1 = ((psImage*)IN1)->numCols; \
+    long numRows2 = ((psImage*)IN2)->numRows; \
+    long numCols2 = ((psImage*)IN2)->numCols; \
+    if (numRows1 != numRows2 || numCols1 != numCols2) { \
+        psError(PS_ERR_BAD_PARAMETER_SIZE, true, PS_ERRORTEXT_psMatrix_IMAGE_SIZE_DIFFERS, \
+                numCols1, numRows1, numCols2, numRows2); \
+        if (OUT != IN1 && OUT != IN2) { \
+            psFree(OUT); \
+        } \
+        return NULL; \
+    } \
+    for (long j = 0; j < numRows1; j++) { \
+        ps##TYPE *o  = ((psImage*)OUT)->data.TYPE[j]; \
+        ps##TYPE *i1 = ((psImage*)IN1)->data.TYPE[j]; \
+        ps##TYPE *i2 = ((psImage*)IN2)->data.TYPE[j]; \
+        for (long i = 0; i < numCols1; i++, o++, i1++, i2++) { \
+            *o = OP; \
+        } \
+    } \
+}
+
+
+// Preprocessor macro function to create arithmetic function based on input type --- for integers only
 #define BINARY_TYPE_INTEGER(DIM1,DIM2,OUT,IN1,OP,IN2)                                                        \
 switch (IN1->type) {                                                                                         \
@@ -418,15 +339,13 @@
 // Preprocessor macro function to create arithmetic function operation name
 #define BINARY_OP(DIM1,DIM2,OUT,IN1,OP,IN2)                                                                  \
-if(!strncmp(OP, "=", 1)) {                                                                                   \
-    BINARY_TYPE(DIM1,DIM2,OUT,IN1,*i2,IN2);                                                                  \
-} else if(!strncmp(OP, "+", 1)) {                                                                            \
+if (!strncmp(OP, "+", 1)) {                                                                                  \
     BINARY_TYPE(DIM1,DIM2,OUT,IN1,*i1 + *i2,IN2);                                                            \
-} else if(!strncmp(OP, "-", 1)) {                                                                            \
+} else if (!strncmp(OP, "-", 1)) {                                                                           \
     BINARY_TYPE(DIM1,DIM2,OUT,IN1,*i1 - *i2,IN2);                                                            \
-} else if(!strncmp(OP, "*", 1)) {                                                                            \
+} else if (!strncmp(OP, "*", 1)) {                                                                           \
     BINARY_TYPE(DIM1,DIM2,OUT,IN1,*i1 * *i2,IN2);                                                            \
-} else if(!strncmp(OP, "/", 1)) {                                                                            \
+} else if (!strncmp(OP, "/", 1)) {                                                                           \
     BINARY_TYPE(DIM1,DIM2,OUT,IN1,*i1 / *i2,IN2);                                                            \
-} else if(!strncmp(OP, "&", 1)) {                                                                            \
+} else if (!strncmp(OP, "&", 1)) {                                                                           \
     if (PS_IS_PSELEMTYPE_INT(IN1->type) && PS_IS_PSELEMTYPE_INT(IN2->type)) {                                \
         BINARY_TYPE_INTEGER(DIM1,DIM2,OUT,IN1,(*i1) & (*i2),IN2);                                            \
@@ -436,5 +355,5 @@
         return NULL;                                                                                         \
     }                                                                                                        \
-} else if(!strncmp(OP, "|", 1)) {                                                                            \
+} else if (!strncmp(OP, "|", 1)) {                                                                           \
     if (PS_IS_PSELEMTYPE_INT(IN1->type) && PS_IS_PSELEMTYPE_INT(IN2->type)) {                                \
         BINARY_TYPE_INTEGER(DIM1,DIM2,OUT,IN1,(*i1) | (*i2),IN2);                                            \
@@ -444,12 +363,12 @@
         return NULL;                                                                                         \
     }                                                                                                        \
-} else if(!strncmp(OP, "^", 1)) {                                                                            \
-    if(PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                                \
+} else if (!strncmp(OP, "^", 1)) {                                                                           \
+    if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
         BINARY_TYPE(DIM1,DIM2,OUT,IN1,cpow(*i1,*i2),IN2);                                                    \
     } else {                                                                                                 \
         BINARY_TYPE(DIM1,DIM2,OUT,IN1,pow(*i1,*i2),IN2);                                                     \
     }                                                                                                        \
-} else if(!strncmp(OP, "min", 3)) {                                                                          \
-    if(PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                                \
+} else if (!strncmp(OP, "min", 3)) {                                                                         \
+    if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                            \
                 PS_ERRORTEXT_psMatrix_MIN_COMPLEX_SUPPORT);                                                  \
@@ -461,6 +380,6 @@
         BINARY_TYPE(DIM1,DIM2,OUT,IN1,fmin(*i1,*i2),IN2);                                                    \
     }                                                                                                        \
-} else if(!strncmp(OP, "max", 3)) {                                                                          \
-    if(PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                                \
+} else if (!strncmp(OP, "max", 3)) {                                                                         \
+    if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                            \
                 PS_ERRORTEXT_psMatrix_MAX_COMPLEX_SUPPORT);                                                  \
@@ -630,9 +549,9 @@
     // Automtically free psScalar types, since they are usually allocated in the argument list when this
     // function is called, provided that the input is not the output.
-    if(psType1->dimen==PS_DIMEN_SCALAR && in1!=out) {
+    if (psType1->dimen==PS_DIMEN_SCALAR && in1!=out) {
         psFree(in1);
     }
 
-    if(psType2->dimen==PS_DIMEN_SCALAR && in2!=out) {
+    if (psType2->dimen==PS_DIMEN_SCALAR && in2!=out) {
         psFree(in2);
     }
