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: Carlo de Falco
Subject: Re: switch from 1-based to 0-based indexing in NDArray::index ()
Date: Wed, 24 Jun 2009 16:56:26 +0200


On 24 Jun 2009, at 16:39, Jaroslav Hajek wrote:

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.

I agree that the new situation is more consistent,
I just wanted to warn anyone who had code relying on the old
constructors to change their code and, in case the code was in an OF package
to update the DESCRIPTION file to make it depend on octave >= 3.1.55.
But maybe this does not affect anyone else but me...
c.






reply via email to

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