octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43925] isscalar behaves incorrectly for some


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #43925] isscalar behaves incorrectly for some user-defined classes
Date: Fri, 20 May 2016 22:47:38 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

Follow-up Comment #24, bug #43925 (project octave):

I can see that this bug is a Matlab compatibility problem that should be
fixed, but I'm having a hard time understanding what the regression is.

I've made a simple class example that overrides the size method and I don't
see any change at all w.r.t isscalar (incorrectly depends on numel in all
versions), so that is not a regression.

I do see differences in isvector and ismatrix, but I don't think either of
them were absolutely correct in 3.8 and broken in 4.0, so I wouldn't call that
a regression either. They may be broken in both 3.8 and 4.0 in different ways,
but that's not really a regression, is it?

I'm not trying to be difficult, just trying to understand to help find the
best way to resolve this. Can you show me what I'm missing?


>> x = myobj (rand (1, 2, 3));
>> size (x)
ans =

   1   2   3

>> isscalar (x)
ans =  1  ## True in Octave 3.6, 3.8, 4.0, and default
>> isvector (x)
ans =  1  ## True in Octave 3.6, 3.8, 4.0, and default
>> ismatrix (x)
ans = 0   ## False in Octave 3.6 and 3.8
ans =  1  ## True in Octave 4.0 and default



Granted this is a somewhat constructed example showing that isvector was buggy
in 3.8 as well. If I change the size to [2,2,3], then isvector correctly
returns false in 3.8 and true in 4.0 and newer.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43925>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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