help-octave
[Top][All Lists]
Advanced

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

Re: switch from 1-based to 0-based indexing in NDArray::index ()


From: Jaroslav Hajek
Subject: Re: switch from 1-based to 0-based indexing in NDArray::index ()
Date: Wed, 24 Jun 2009 16:39:09 +0200

On Wed, Jun 24, 2009 at 4:32 PM, Carlo de Falco<address@hidden> wrote:
>
> On 24 Jun 2009, at 16:27, Jaroslav Hajek wrote:
>
>> There was a change in the idx_vector (octave_idx_type) constructor.
>> This was made to be consistent with the new idx_vector
>> (Array<octave_idx_type>) constructor, which needs to use zero-based
>> indexing. It wasn't announced anywhere, I think.
>
> OK, so it has been announced now, then ;)
> This was breaking a few functions in some of my packages,
> I guess others may have similar problems...
> c.
>
>

I think this was an inconsistency that should have been fixed anyway.
Intended for use in C++ functions are the constructors for a single
index, range (upper exclusive), and index array, all using zero-based
indexing:

idx_vector (octave_idx_type i)
idx_vector (octave_idx_type start, octave_idx_type limit,
              octave_idx_type step = 1)
idx_vector (const Array<octave_idx_type>& inda)

 The other constructors are used mainly in octave_value classes.

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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