[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Array::insert methods
From: |
John W. Eaton |
Subject: |
Array::insert methods |
Date: |
Fri, 15 Jan 2010 15:03:24 -0500 |
On 15-Jan-2010, Jaroslav Hajek wrote:
| the following changeset:
| http://hg.savannah.gnu.org/hgweb/octave/rev/ed49cef7e005
|
| simplifies the Array<T>::insert methods, making them essentially
| wrappers for Array<T>::assign. I was not strictly sure about the
| intent of the methods, however.
| Here is the documentation I wrote:
|
| // Insert an array into another at a specified position.
| // If size (a) is [d1 d2 ... dN] and idx is [i1 i2 ... iN],
| // this method is equivalent to
| // x(i1:i1+d1-1, i2:i2+d2-1, ... , iN:iN+dN-1) = a.
| Array<T>& insert (const Array<T>& a, const Array<octave_idx_type>& idx);
|
| // This is just a special case for idx = [r c 0 ...]
| Array<T>& insert (const Array<T>& a, octave_idx_type r, octave_idx_type c);
|
| John (or anyone), can you confirm this was the true intent?
Yes, I think that's the intent. As I recall, the original functions
were defined in the Matrix or Vector classes and the idea was to be
able to insert a smaller array inside a larger one, beginning at some
specified location in the larger Matrix or Vector object.
jwe