diff src/ops.h @ 4543:79df15d4470c

[project @ 2003-10-18 03:53:52 by jwe]
author jwe
date Sat, 18 Oct 2003 03:53:53 +0000
parents bc61b0e8d60e
children 69a9b22a72a2
line wrap: on
line diff
--- a/src/ops.h	Fri Oct 17 04:41:36 2003 +0000
+++ b/src/ops.h	Sat Oct 18 03:53:53 2003 +0000
@@ -190,6 +190,13 @@
     return octave_value (op v.t ## _value ()); \
   }
 
+#define DEFNDUNOP_OP(name, t, op) \
+  UNOPDECL (name, a) \
+  { \
+    CAST_UNOP_ARG (const octave_ ## t&); \
+    return octave_value (op v.array_value ()); \
+  }
+
 // XXX FIXME XXX -- in some cases, the constructor isn't necessary.
 
 #define DEFUNOP_FN(name, t, f) \
@@ -199,6 +206,13 @@
     return octave_value (f (v.t ## _value ())); \
   }
 
+#define DEFNDUNOP_FN(name, t, f) \
+  UNOPDECL (name, a) \
+  { \
+    CAST_UNOP_ARG (const octave_ ## t&); \
+    return octave_value (f (v.array_value ())); \
+  }
+
 #define DEFNCUNOP_METHOD(name, t, method) \
   static void \
   oct_unop_ ## name (octave_value& a) \
@@ -225,6 +239,14 @@
       (v1.t1 ## _value () op v2.t2 ## _value ()); \
   }
 
+#define DEFNDBINOP_OP(name, t1, t2, e1, e2, op) \
+  BINOPDECL (name, a1, a2) \
+  { \
+    CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+    return octave_value \
+      (v1.e1 ## _value () op v2.e2 ## _value ()); \
+  }
+
 // XXX FIXME XXX -- in some cases, the constructor isn't necessary.
 
 #define DEFBINOP_FN(name, t1, t2, f) \
@@ -234,6 +256,13 @@
     return octave_value (f (v1.t1 ## _value (), v2.t2 ## _value ())); \
   }
 
+#define DEFNDBINOP_FN(name, t1, t2, e1, e2, f) \
+  BINOPDECL (name, a1, a2) \
+  { \
+    CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+    return octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \
+  }
+
 #define BINOP_NONCONFORMANT(msg) \
   gripe_nonconformant (msg, \
 		       a1.rows (), a1.columns (), \