diff src/ov.h @ 10670:654fbde5dceb

make cellfun's fast scalar collection mechanism public
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 28 May 2010 12:28:06 +0200
parents d1194069e58c
children 604e13a89c7f
line wrap: on
line diff
--- a/src/ov.h	Thu May 27 20:12:51 2010 -0700
+++ b/src/ov.h	Fri May 28 12:28:06 2010 +0200
@@ -1139,6 +1139,22 @@
   octave_value map (octave_base_value::unary_mapper_t umap) const
     { return rep->map (umap); }
 
+  // Extract the n-th element, aka val(n). Result is undefined if val is not an
+  // array type or n is out of range. Never error.
+  octave_value
+  fast_elem_extract (octave_idx_type n) const
+    { return rep->fast_elem_extract (n); }
+
+  // Assign the n-th element, aka val(n) = x. Returns false if val is not an
+  // array type, x is not a matching scalar type, or n is out of range.
+  // Never error.
+  virtual bool
+  fast_elem_insert (octave_idx_type n, const octave_value& x)
+    {
+      make_unique ();
+      return rep->fast_elem_insert (n, x);
+    }
+
 protected:
 
   // The real representation.