Index: /trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
===================================================================
--- /trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c	(revision 1138)
+++ /trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c	(revision 1139)
@@ -29,6 +29,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-29 20:28:47 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-30 01:31:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -78,8 +78,8 @@
 
 // Conversion for degrees to radians
-#define D2R M_PI/360.0
+#define D2R M_PI/180.0
 
 // Conversion for radians to degrees
-#define R2D 360.0/M_PI
+#define R2D 180.0/M_PI
 
 // Division with NAN checking
@@ -444,4 +444,24 @@
     }
 
+    if(dim1 == PS_DIMEN_VECTOR) {
+        if(((psVector*)in1)->n == 0) {
+            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");
+        }
+    }
+
+    if(dim2 == PS_DIMEN_VECTOR) {
+        if(((psVector*)in2)->n == 0) {
+            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");
+        }
+    }
+
     if(dim1 == PS_DIMEN_SCALAR) {
         if(dim2 == PS_DIMEN_SCALAR) {
@@ -592,5 +612,5 @@
 } else if(!strncmp(OP, "ten", 3)) {                                                                          \
     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) {                                                                 \
-        UNARY_TYPE(DIM,OUT,IN,cpow(*i1,10.0));                                                               \
+        UNARY_TYPE(DIM,OUT,IN,cpow(10.0,*i1));                                                               \
     } else {                                                                                                 \
         UNARY_TYPE(DIM,OUT,IN,exp10(*i1));                                                                   \
@@ -721,4 +741,24 @@
     }
 
+    if(dimIn == PS_DIMEN_VECTOR) {
+        if(((psVector*)in)->n == 0) {
+            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");
+        }
+    }
+
+    if(dimOut == PS_DIMEN_VECTOR) {
+        if(((psVector*)out)->n == 0) {
+            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");
+        }
+    }
+
     if(dimIn == PS_DIMEN_SCALAR) {
         UNARY_OP(SCALAR,out,psTypeIn,op);                                 // scalar
