octave-maintainers
[Top][All Lists]
Advanced

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

Re: Class related regressions in GNU Octave 4.0


From: Oliver Heimlich
Subject: Re: Class related regressions in GNU Octave 4.0
Date: Mon, 13 Apr 2015 22:27:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0

On 13.04.2015 07:34, Oliver Heimlich wrote:
On 13.04.2015 00:14, Michael Godfrey wrote:
Matlab R2015a Said (after fixing quotes, etc.):

[SNIP]

Michael, thanks for checking.

This classifies all three bugs as MATLAB incompatibilities. I am going
to prepare patches.

Oliver


I have looked into the code. I see the following dependencies:

size calls dims () if not overridden.
isscalar calls numel (), which uses dims () if not overridden.
isvector as well as isrow and iscolumn call dims ().
isequal calls octave_base_value::size, which uses dims ().

So, all functions in question end up using the function dims () by default, which currently can't be overridden by the class with m-files.

To get a consistent behaviour I would have to change octave_class::dims and evaluate the overridden size function if it exists. This sounds like it could work, but is quite a big change with possible dependencies—so I am not sure. What do you think?

On the way through the sources I have learned that octave_class::dims assumes that the object is represented by a structure array [1], a datatype which I have never used before. The structure array data type is perfect for what I want to store in my class instances, and, if I use it, I don't even have to override the size or numel methods in the first place and everything just works (in 3.8.2 and in 4.0).

[1] https://www.gnu.org/software/octave/doc/interpreter/Structure-Arrays.html



reply via email to

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