changeset 12758:ecd1364a2700 stable

allow assignment of [], "", and '' to sparse logical matrix * op-sbm-bm.cc (DEFNULLASSIGNOP_FN (null_assign, ...)): New assignment operator function. (install_sbm_bm_ops): Install it for various RHS types.
author John W. Eaton <jwe@octave.org>
date Mon, 20 Jun 2011 11:11:16 -0400
parents 824c60c8f7b9
children 34cd2fcfdcb8 e8fe03bfc051
files src/OPERATORS/op-sbm-bm.cc
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/OPERATORS/op-sbm-bm.cc	Mon Jun 20 11:03:21 2011 -0400
+++ b/src/OPERATORS/op-sbm-bm.cc	Mon Jun 20 11:11:16 2011 -0400
@@ -43,6 +43,7 @@
 #include "ov-scalar.h"
 #include "ov-str-mat.h"
 #include "ops.h"
+#include "ov-null-mat.h"
 #include "ov-re-sparse.h"
 #include "ov-bool-sparse.h"
 #include "smx-bm-sbm.h"
@@ -88,6 +89,8 @@
   return octave_value ();
 }
 
+DEFNULLASSIGNOP_FN (null_assign, sparse_bool_matrix, delete_elements)
+
 static octave_value
 oct_assignop_conv_and_assign (octave_base_value& a1,
                               const octave_value_list& idx,
@@ -154,4 +157,11 @@
                     conv_and_assign);
   INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint64_matrix,
                     conv_and_assign);
+
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_matrix,
+                    null_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_str,
+                    null_assign);
+  INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_sq_str,
+                    null_assign);
 }