# HG changeset patch # User John W. Eaton # Date 1429982282 14400 # Node ID 0d56160e346d5d1fe7cac15ce6feed19655a3106 # Parent 0aed244dbdb33bb5f99250e7c88c46eee951051d 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. diff -r 0aed244dbdb3 -r 0d56160e346d libinterp/octave-value/ov-lazy-idx.cc --- 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), diff -r 0aed244dbdb3 -r 0d56160e346d libinterp/octave-value/ov-lazy-idx.h --- 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;