bugGNU Octave - Bugs: bug #37565, size_equal gives false positives...


bug #37565: size_equal gives false positives for user-defined classes

Submitted by:  Lukas Reichlin <paramaniac>
Submitted on:  Sat 13 Oct 2012 06:16:10 PM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  3.6.3 Operating System:  Mac OS

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 18 Oct 2012 04:24:33 PM UTC, comment #5: 

Nice, and the problem is solved!

Rik <rik5>
Project Administrator
Thu 18 Oct 2012 04:20:21 PM UTC, comment #4: 
Lukas Reichlin <paramaniac>
Thu 18 Oct 2012 03:40:05 AM UTC, comment #3: 

I think the problem is that you have an overload for the size() function, but not for the size_equal function.  The size_equal function is written in C++ and is looking at the dimension vector for the object.  This is not the same thing as calling the size() function on an object.

For example, with your inputs from the control package.

a = WestlandLynx;
b = Boeing707;
c = BMWengine;
numel (a)
ans =  1
numel (b)
ans =  1
numel (c)
ans =  1

It might be possible to call the overloaded size function from within C++, but I think it will be easier and faster for you to just overload size_equal in the @lti class.

Rik <rik5>
Project Administrator
Sun 14 Oct 2012 04:52:51 PM UTC, comment #2: 

sa =

   6   4

sb =

   2   2

sc =

   2   4

s =  1

Lukas Reichlin <paramaniac>
Sun 14 Oct 2012 03:49:30 PM UTC, comment #1: 

In your example, could you also post what Octave returned for the variables sa, sb, and sc?

Rik <rik5>
Project Administrator
Sat 13 Oct 2012 06:16:10 PM UTC, original submission:  

size_equal gives false positives for user-defined classes, e.g. LTI class from the control package:

## requires the control package

a = WestlandLynx;
b = Boeing707;
c = BMWengine;

sa = size (a)
sb = size (b)
sc = size (c)

s = size_equal (a, b, c)  # s should be false

The arguments a, b, c have different sizes, but size_equal returns true, which is wrong.

Lukas Reichlin <paramaniac>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by paramaniac (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-10-18 rik5 Open/ClosedOpen => Closed
    2012-10-14 rik5 StatusNone => Need Info

    Back to the top

    Powered by Savane 3.5