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: Julien Bect
Subject: [Octave-bug-tracker] [bug #43925] isscalar behaves incorrectly for some user-defined classes
Date: Sat, 03 Jan 2015 18:24:47 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:34.0) Gecko/20100101 Firefox/34.0

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

                 Summary: isscalar behaves incorrectly for some user-defined
classes
                 Project: GNU Octave
            Submitted by: jbect
            Submitted on: sam. 03 janv. 2015 18:24:46 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

In Octave 3.8.2, isscalar(x) returns true if numel(x) is 1.

In Matlab, isscalar(x) returns true if size(x) is [1 1].

http://www.mathworks.com/help/matlab/ref/isscalar.html

These two conditions are not always equivalent.

For instance, in the case of a user-defined class that overloads size, it is
possible to have size (x) equal to [6 4] but numel (x) equal to 1. (And
overloading numel too is not always an option, since the result of numel
matters for subsref.)

isscalar has been rewritten in C++ on the default branch, but the behaviour is
still the same.




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/




reply via email to

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