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

 
 

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

Submitter:  Lukas Reichlin <paramaniac>
Submitted:  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
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Nice, and the problem is solved!

Rik <rik5>
Group 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>
Group 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>
Group 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:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group 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.13-f8d8.
    Corresponding source code