Mercurial > octave-nkf
comparison src/OPERATORS/op-sbm-bm.cc @ 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 | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
12757:824c60c8f7b9 | 12758:ecd1364a2700 |
---|---|
41 #include "ov-uint64.h" | 41 #include "ov-uint64.h" |
42 #include "ov-range.h" | 42 #include "ov-range.h" |
43 #include "ov-scalar.h" | 43 #include "ov-scalar.h" |
44 #include "ov-str-mat.h" | 44 #include "ov-str-mat.h" |
45 #include "ops.h" | 45 #include "ops.h" |
46 #include "ov-null-mat.h" | |
46 #include "ov-re-sparse.h" | 47 #include "ov-re-sparse.h" |
47 #include "ov-bool-sparse.h" | 48 #include "ov-bool-sparse.h" |
48 #include "smx-bm-sbm.h" | 49 #include "smx-bm-sbm.h" |
49 #include "smx-sbm-bm.h" | 50 #include "smx-sbm-bm.h" |
50 | 51 |
85 CAST_BINOP_ARGS (octave_sparse_bool_matrix&, const octave_bool_matrix&); | 86 CAST_BINOP_ARGS (octave_sparse_bool_matrix&, const octave_bool_matrix&); |
86 | 87 |
87 v1.assign (idx, SparseBoolMatrix (v2.bool_matrix_value ())); | 88 v1.assign (idx, SparseBoolMatrix (v2.bool_matrix_value ())); |
88 return octave_value (); | 89 return octave_value (); |
89 } | 90 } |
91 | |
92 DEFNULLASSIGNOP_FN (null_assign, sparse_bool_matrix, delete_elements) | |
90 | 93 |
91 static octave_value | 94 static octave_value |
92 oct_assignop_conv_and_assign (octave_base_value& a1, | 95 oct_assignop_conv_and_assign (octave_base_value& a1, |
93 const octave_value_list& idx, | 96 const octave_value_list& idx, |
94 const octave_base_value& a2) | 97 const octave_base_value& a2) |
152 conv_and_assign); | 155 conv_and_assign); |
153 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint32_matrix, | 156 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint32_matrix, |
154 conv_and_assign); | 157 conv_and_assign); |
155 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint64_matrix, | 158 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_uint64_matrix, |
156 conv_and_assign); | 159 conv_and_assign); |
160 | |
161 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_matrix, | |
162 null_assign); | |
163 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_str, | |
164 null_assign); | |
165 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_null_sq_str, | |
166 null_assign); | |
157 } | 167 } |