octave-maintainers
[Top][All Lists]
Advanced

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

Re: octave "Most Wanted" feature


From: David Bateman
Subject: Re: octave "Most Wanted" feature
Date: Tue, 28 Nov 2006 21:37:10 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

robert bristow-johnson wrote:

> Yes, it requires rewriting a few parts deep inside of Octave (but 
> in such a way as to preserve backward compatibility which we all
> should consider to be super-important).  I tried to explain this
> before.  Here it is again, but I'll try to focus what it would be.
> I do not know where to even begin to find this in the Octave code,
> but imagining that Octave is written in C or C++, a single Octave
> variable would have a structure definition that might look like
> and have similar fields:

If we accept that all indices are either 1 or 0 indexed, then no I don't
think there are that many changes to the C++ code of octave. Essential
the idx-vector class would have a flag on how the indexing is done.
There will be several functions that do a +1 to return values in C++,
such as find or sort that would need to respect the default indexing
type, and that'll lead to the potential for many errors. The basic code
itself in liboctave is all zero indexed based, and that shouldn't change.

However, I think this is a case where matlab compatibility will cause
much pain. This idea would condemn all of the octave script files to
special case of one- or zero-based index, making the code harder to
maintain and slower. Basically, my feeling we can't support both one and
zero indexing, and matlab has to make to move first...

Note that I have experience in fortran programming and see no issue
between one and zero indexing as such, as long as we stick one of these.
I would of course have preferred that both C and fortran were consistent
in their indexing.

Regards
David


reply via email to

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