bugGNU Octave - Bugs: bug #44498, isvector: Always returns true for...

 
 

bug #44498: isvector: Always returns true for objects from user defined classes

Submitted by:  Oliver Heimlich <oheim>
Submitted on:  Tue 10 Mar 2015 06:58:06 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: NoneAssigned to: None
Originator Name: Oliver HeimlichOpen/Closed: Open
Release: 4.0.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Wed 18 May 2016 12:56:38 PM UTC, comment #6:

A patch that solves this issues has been proposed in bug report #43925 and is currently waiting to be reviewed.

Julien Bect <jbect>
Fri 12 Feb 2016 01:27:20 PM UTC, comment #5:

See bug #43925 for work in progress on this issue.

Julien Bect <jbect>
Sat 30 Jan 2016 02:22:32 AM UTC, comment #4:

It is easy to replace dims() by size() in Fisvector -- see attached patch.

The wrinkle is that size() is not const, and so a copy has to be made. That should be a shallow copy, shouldn't it? If not, we should probably check that size has actually been overloaded and use dims() if not.

(file #36204)

Lachlan Andrew <lachlan>
Project Member
Tue 26 Jan 2016 05:30:58 AM UTC, comment #3:

Yes, option 2 should be the right one. The patch for bug #44334 has introduced some xtests regarding this regression. The xtests have been verified for Matlab compatibility.

To summarize the discussion from bug #44334: The user defined class needs to override size and numel. Then other functions should respect this.

Anonymous
Tue 26 Jan 2016 05:02:33 AM UTC, comment #2:

I'm happy to try to produce a fix if someone confirms that option 2 is the one to go with. jwe, I think it is your call.

Lachlan Andrew <lachlan>
Project Member
Tue 02 Jun 2015 04:35:44 PM UTC, comment #1:

Retagging release from 4.0.0-rc1 to 4.0.0.

John W. Eaton <jwe>
Project Administrator
Tue 10 Mar 2015 06:58:06 AM UTC, original submission:

The function isvector always returns true for user defined objects (whose builtin size is [1 1]). However, the user defined class may have overridden the size method.

See bug #43925 for a similar regression with isscalar and bug #44334 for a similar regression with iseuqal. In GNU Octave 3.8.2 the overriden size had been respected by isscalar, isvector, and isequal.

What is the desired behaviour?
1) A user-defined class must override all methods together to get a consistent behaviour: size, isvector, isscalar, and isequal. Any builtin functions will assume that the object's size is always [1 1].
2) A user-defined class must override size only. The builtin functions will respect the overriden size method and produce a consistent behaviour for the user (like they did in version 3.8.2).

Oliver Heimlich <oheim>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #36204:  bug_44498.cset added by lachlan (908B - application/octet-stream)

 

Digest:
   bug dependencies.

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by jbect (Posted a comment)
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by oheim (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 23 Feb 2017 02:25:59 PM UTCsiko1056Dependencies-=>Depends on bugs #43925
    Tue 12 Jul 2016 07:01:06 PM UTCmtmillerDependencies-=>bugs #48487 is dependent
    Sat 30 Jan 2016 02:22:31 AM UTClachlanAttached File-=>Added bug_44498.cset, #36204
    Tue 02 Jun 2015 04:35:44 PM UTCjweRelease4.0.0-rc1=>4.0.0

    Back to the top


    Powered by Savane 3.1-cleanup1