bugGNU Octave - Bugs: bug #45118, isequal doesn't call overloaded...

 
 

bug #45118: isequal doesn't call overloaded isequal on struct fields

Submitter:  Julien Bect <jbect>
Submitted:  Sun 17 May 2015 07:09:48 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 16 May 2016 08:41:32 AM UTC, comment #7: 

The problem is solved in Octave 4.0.2:


>> pkg install -forge stk
>> pkg load stk
>> x = stk_dataframe (rand (3, 2), {'A' 'B'})

x = <3x2 stk_dataframe array>

   :         A         B
 * :  0.143348  0.299240
 * :  0.407387  0.134785
 * :  0.176241  0.122200

>> isequal (x, x)
ans =  1
>> xx.a = x;
>> isequal (xx, xx)
ans =  1


This bug report can be closed.

Julien Bect <jbect>
Tue 26 Jan 2016 05:30:13 AM UTC, comment #6: 

The patch for bug #44334 was applied.  Can this bug report be closed now?

Lachlan Andrew <lachlan>
Tue 16 Jun 2015 07:14:21 PM UTC, comment #5: 

The patch submitted for bug #44334 solves this issue as well.

Julien Bect <jbect>
Tue 02 Jun 2015 04:51:45 PM UTC, comment #4: 

Retagging release from 4.0.0-rc4 to 4.0.0.

John W. Eaton <jwe>
Group administrator
Sun 17 May 2015 06:16:12 PM UTC, comment #3: 

I have debugged into your described problem. The internal _isequal_ function is called recursive on the fields of the struct until it finds the @class objects to be compared, which use an overridden size method.  Then it exits early, because the overridden size is different from the builtin size.

The cause of the error is the same as in bug #44334 and the patch submitted there should solve the issue.

Julien, please confirm whether the patch fixes the problem.

Oliver Heimlich <oheim>
Sun 17 May 2015 02:14:09 PM UTC, comment #2: 

Not a duplicate, but perhaps related.

I haven't tried your patch yet.

Julien Bect <jbect>
Sun 17 May 2015 07:40:18 AM UTC, comment #1: 

Duplicate or related to bug #44334 ? You can find a patch there, but nobody has reviewed it. Does the patch solve your problem?

Oliver Heimlich <oheim>
Sun 17 May 2015 07:09:48 AM UTC, original submission:  

The title says it all: isequal doesn't call overloaded isequal on struct fields.

Here is an example.


>> pkg install -forge stk  # currently, stk 2.2.1
>> pkg load stk
>> x = stk_dataframe (rand (3, 2), {'A' 'B'})

x = <3x2 stk_dataframe array>

   :         A         B
 * :  0.433623  0.516320
 * :  0.119426  0.044071
 * :  0.378124  0.801516


Now, using a breakpoint in @stk_dataframe/isequal.m, I can confirm that the overload isequal is called in this case:


>> isequal (x, x)
ans =  1


but not in this case:


>> xx.a = x;
>> isequal (xx, xx)
ans =  0


Julien Bect <jbect>

 

(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 mtmiller (Updated the item)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by oheim (Posted a comment)
  • -email is unavailable- added by jbect (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-16 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2015-06-02 jwe Release4.0.0-rc4 4.0.0

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code