bugGNU Octave - Bugs: bug #33062, resize and reshape used with...

 
 

bug #33062: resize and reshape used with objects return structures

Submitted by:  None
Submitted on:  Wed 13 Apr 2011 12:29:29 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: David Bateman <dbateman>
Originator Name: David BatemanOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 19 Apr 2011 12:39:01 AM UTC, comment #4:

Applied to stable in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/3b2e005e4219)

Rik <rik5>
Project Administrator
Sun 17 Apr 2011 06:40:34 PM UTC, comment #3:

The size is calculated as the number of elements multiplied by the size of the element. This is true for all Octave data types, so I don't find that a 1x0 object occupies O bytes as given by "whos" as surprising.

As for the second issue; The fact that you can resize or reshape the object doesn't mean that the methods of the class have to make sense of the objects that are reshaped. I picked the "ftp" class as the only class that is included with Octave itself, and that makes demonstrating the issue easiest. Unfortunately the methods of the ftp class can only had 1x1 objects as you found out. I was aware of this when I submitted the bug report, but went with the convenience of using he "ftp" class to demonstrate the issue.

Its easy to create a test class that demonstrates the issue with a class that can handle MxN objects, for example the MTEX package was several of them.
D.

David Bateman <dbateman>
Project MemberIn charge of this item.
Thu 14 Apr 2011 11:39:23 PM UTC, comment #2:

While testing your patch I ran into some issues. See below:

Is 'a' really supposed to occupy 0 bytes?

Also, the instance 'a' does not work whereas instance 'b' does.

Rik <rik5>
Project Administrator
Wed 13 Apr 2011 02:15:22 PM UTC, comment #1:

As I don't have access to my development (including the tree I can check in form), could someone commit the attached changest and I close this bug

David

(file #23233)

David Bateman <dbateman>
Project MemberIn charge of this item.
Wed 13 Apr 2011 12:29:29 PM UTC, original submission:

Consider the code

a = resize (ftp('ftp.octave.org'), 1, 0);
whos a

This returns a structure rather than a class of the type "ftp". A similar result is obtained with the resize function. I propose the patch attached

D.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #23233:  changeset added by dbateman (2KiB - application/octet-stream)
file #23232:  patch added by None (816B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dbateman (Updated the item)
  • -unavailable- added by None (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Apr 2011 12:39:01 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 13 Apr 2011 02:15:22 PM UTCdbatemanAttached File-=>Added changeset, #23233
      StatusNone=>Patch Submitted
      Assigned toNone=>dbateman
    Wed 13 Apr 2011 12:29:29 PM UTCNoneAttached File-=>Added patch, #23232

    Back to the top


    Powered by Savane 3.1-cleanup1