diff src/OPERATORS/op-cs-cs.cc @ 3203:bc61b0e8d60e

[project @ 1998-10-30 20:26:27 by jwe]
author jwe
date Fri, 30 Oct 1998 20:26:31 +0000
parents 295f037b4b3e
children 0ff7323dab8b
line wrap: on
line diff
--- a/src/OPERATORS/op-cs-cs.cc	Thu Oct 29 20:28:02 1998 +0000
+++ b/src/OPERATORS/op-cs-cs.cc	Fri Oct 30 20:26:31 1998 +0000
@@ -37,6 +37,28 @@
 #include "xdiv.h"
 #include "xpow.h"
 
+// unary complex scalar ops.
+
+DEFUNOP (not, complex)
+{
+  CAST_UNOP_ARG (const octave_complex&);
+
+  return octave_value (v.complex_value () == 0.0);
+}
+
+DEFUNOP_OP (uminus, complex, -)
+DEFUNOP_OP (transpose, complex, /* no-op */)
+
+DEFUNOP (hermitian, complex)
+{
+  CAST_UNOP_ARG (const octave_complex&);
+
+  return octave_value (conj (v.complex_value ()));
+}
+
+DEFNCUNOP_METHOD (incr, complex, increment)
+DEFNCUNOP_METHOD (decr, complex, decrement)
+
 // complex scalar by complex scalar ops.
 
 DEFBINOP_OP (add, complex, complex, +)
@@ -163,6 +185,14 @@
 void
 install_cs_cs_ops (void)
 {
+  INSTALL_UNOP (not, octave_complex, not);
+  INSTALL_UNOP (uminus, octave_complex, uminus);
+  INSTALL_UNOP (transpose, octave_complex, transpose);
+  INSTALL_UNOP (hermitian, octave_complex, hermitian);
+
+  INSTALL_NCUNOP (incr, octave_complex, incr);
+  INSTALL_NCUNOP (decr, octave_complex, decr);
+
   INSTALL_BINOP (add, octave_complex, octave_complex, add);
   INSTALL_BINOP (sub, octave_complex, octave_complex, sub);
   INSTALL_BINOP (mul, octave_complex, octave_complex, mul);