diff src/OPERATORS/op-cm-cm.cc @ 9546:1beb23d2b892

optimize op= in common cases
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 19 Aug 2009 13:47:59 +0200
parents eb63fbe60fab
children 3a1dd361f978
line wrap: on
line diff
--- a/src/OPERATORS/op-cm-cm.cc	Mon Aug 17 14:46:18 2009 +0200
+++ b/src/OPERATORS/op-cm-cm.cc	Wed Aug 19 13:47:59 2009 +0200
@@ -163,6 +163,9 @@
 
 DEFNULLASSIGNOP_FN (null_assign, complex_matrix, delete_elements)
 
+DEFNDASSIGNOP_OP (assign_add, complex_matrix, complex_matrix, complex_array, +=)
+DEFNDASSIGNOP_OP (assign_sub, complex_matrix, complex_matrix, complex_array, -=)
+
 CONVDECL (complex_matrix_to_float_complex_matrix)
 {
   CAST_CONV_ARG (const octave_complex_matrix&);
@@ -213,6 +216,9 @@
   INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_str, null_assign);
   INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_sq_str, null_assign);
 
+  INSTALL_ASSIGNOP (op_add_eq, octave_complex_matrix, octave_complex_matrix, assign_add);
+  INSTALL_ASSIGNOP (op_sub_eq, octave_complex_matrix, octave_complex_matrix, assign_sub);
+
   INSTALL_CONVOP (octave_complex_matrix, octave_float_complex_matrix, 
 		  complex_matrix_to_float_complex_matrix);
 }