octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about Array::index with resizing


From: Michael Goffioul
Subject: Question about Array::index with resizing
Date: Wed, 22 May 2013 22:06:43 -0400

Could anybody enlighten me about the implementation of

Array<T>
Array<T>::index (const Array<idx_vector>& ia,
                 bool resize_ok, const T& rfv) const

I'm trying to use it in the classdef branch, assuming this function would resize the array is the given index is out of bound. In my case, "ia" contains only scalars, so the variable "all_scalars" ends up being true. But then the code does:

          if (all_scalars)
            return Array<T> (dim_vector (1, 1), rfv);

In other words, the code always return an array with a single element being the resize_fill_value. No resizing or array indexing actually takes place.

Is it intentional? Unimplemented? Or am I missing something?

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]