changeset 20131:0d56160e346d

make printf of lazy-index object work again (bug #44864) * ov-lazy-idx.h, ov-lazy-idx.cc (octave_lazy_index::fast_elem_extract): New function.
author John W. Eaton <jwe@octave.org>
date Sat, 25 Apr 2015 13:18:02 -0400
parents 0aed244dbdb3
children d7bea5b11fc3
files libinterp/octave-value/ov-lazy-idx.cc libinterp/octave-value/ov-lazy-idx.h
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-lazy-idx.cc	Sat Apr 25 12:17:51 2015 -0400
+++ b/libinterp/octave-value/ov-lazy-idx.cc	Sat Apr 25 13:18:02 2015 -0400
@@ -70,6 +70,12 @@
 }
 
 octave_value
+octave_lazy_index::fast_elem_extract (octave_idx_type n) const
+{
+  return double (index.checkelem (n) + 1);
+}
+
+octave_value
 octave_lazy_index::reshape (const dim_vector& new_dims) const
 {
   return idx_vector (index.as_array ().reshape (new_dims),
--- a/libinterp/octave-value/ov-lazy-idx.h	Sat Apr 25 12:17:51 2015 -0400
+++ b/libinterp/octave-value/ov-lazy-idx.h	Sat Apr 25 13:18:02 2015 -0400
@@ -53,6 +53,8 @@
 
   octave_base_value *try_narrowing_conversion (void);
 
+  octave_value fast_elem_extract (octave_idx_type n) const;
+
   size_t byte_size (void) const { return numel () * sizeof (octave_idx_type); }
 
   octave_value squeeze (void) const;