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

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

[Octave-bug-tracker] [bug #44334] isequal fails to compare size of objec


From: Oliver Heimlich
Subject: [Octave-bug-tracker] [bug #44334] isequal fails to compare size of objects
Date: Sat, 21 Feb 2015 12:23:02 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.4.0

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

                 Summary: isequal fails to compare size of objects
                 Project: GNU Octave
            Submitted by: oheim
            Submitted on: Sa 21 Feb 2015 12:23:00 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: Oliver Heimlich
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

With the patch from bug #42408 (revision 18785:1f170b211be3) the following
regression has been introduced: When x is an object whose class overrides the
size function and x's size is not [1 1] then isequal (x, x) == false.

E.g.:

octave:1> pkg load interval
octave:2> x = infsup (magic (3));
octave:3> isequal (x, x)
ans = 0


The reason is, that the new code uses cellfun for checking sizes:

t = all (size (x,k) == cellfun ("size", varargin, k));


cellfun ("size", …) evaluates the built-in size function and not the
overriden size function from the class. Thus, t will eventually be false if
size (x, k) ~= 1 for any k.

Proposed fix: Use cellfun (@size, …) instead of cellfun ("size", …)




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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