diff src/ov-base-mat.cc @ 8150:283989f2da9b

make null assignment matlab compatible
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 26 Sep 2008 11:52:01 -0400
parents a1dbe9d80eee
children 6c08e3921d3e
line wrap: on
line diff
--- a/src/ov-base-mat.cc	Thu Sep 25 13:44:51 2008 -0400
+++ b/src/ov-base-mat.cc	Fri Sep 26 11:52:01 2008 -0400
@@ -206,6 +206,23 @@
 }
 
 template <class MT>
+void
+octave_base_matrix<MT>::delete_elements (const octave_value_list& idx)
+{
+  octave_idx_type len = idx.length ();
+
+  Array<idx_vector> ra_idx (len);
+
+  for (octave_idx_type i = 0; i < len; i++)
+    ra_idx(i) = idx(i).index_vector ();
+
+  matrix.maybe_delete_elements (ra_idx, MT::resize_fill_value ());
+
+  // Invalidate the matrix type
+  typ.invalidate_type ();
+}
+
+template <class MT>
 octave_value
 octave_base_matrix<MT>::resize (const dim_vector& dv, bool fill) const
 {