diff liboctave/mx-op-defs.h @ 3585:d9803711e047

[project @ 2000-02-08 04:35:39 by jwe]
author jwe
date Tue, 08 Feb 2000 04:35:47 +0000
parents a93683ccc9ba
children 7c8e3c42ed04
line wrap: on
line diff
--- a/liboctave/mx-op-defs.h	Mon Feb 07 09:24:41 2000 +0000
+++ b/liboctave/mx-op-defs.h	Tue Feb 08 04:35:47 2000 +0000
@@ -569,7 +569,7 @@
  \
       if (m_nr > 0 && m_nc > 0) \
 	{ \
-	  r = m; \
+	  r = R (m); \
  \
 	  int len = dm.length (); \
  \
@@ -630,14 +630,12 @@
 
 // diagonal matrix by matrix operations.
 
-// XXX FIXME XXX -- DM - M will not give the correct result.
-
 #define DMM_BIN_OP_DECLS(R, DM, M) \
   BIN_OP_DECL (R, operator +, DM, M); \
   BIN_OP_DECL (R, operator -, DM, M); \
   BIN_OP_DECL (R, operator *, DM, M);
 
-#define DMM_BIN_OP(R, OP, DM, M, OPEQ) \
+#define DMM_BIN_OP(R, OP, DM, M, OPEQ, PREOP) \
 R \
 OP (const DM& dm, const M& m) \
 { \
@@ -655,7 +653,7 @@
     { \
       if (m_nr > 0 && m_nc > 0) \
 	{ \
-	  r = m; \
+	  r = R (PREOP m); \
  \
 	  int len = dm.length (); \
  \
@@ -709,9 +707,9 @@
 }
 
 #define DMM_BIN_OPS(R, DM, M, ZERO) \
-  DMM_BIN_OP (R, operator +, DM, M, +=) \
-  DMM_BIN_OP (R, operator -, DM, M, -=) \
-  DMM_MULTIPLY_OP(R, DM, M, ZERO)
+  DMM_BIN_OP (R, operator +, DM, M, +=, ) \
+  DMM_BIN_OP (R, operator -, DM, M, +=, -) \
+  DMM_MULTIPLY_OP (R, DM, M, ZERO)
 
 #define DMM_OP_DECLS(R, DM, M) \
   DMM_BIN_OP_DECLS(R, DM, M)