patchGNU Octave - Patches: patch #7420, skewness.m: initialise the output...

 
 

patch #7420: skewness.m: initialise the output from the input

Submitter:  Pascal Dupuis <cdemills>
Submitted:  Fri 17 Dec 2010 03:01:49 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 22 Dec 2010 08:48:05 AM UTC, comment #3: 

Moreover,
zeros(10, 1, class('dataframe'))

produces

error: zeros: invalid class name

Regards

Pascal

Pascal Dupuis <cdemills>
Group Member
Wed 22 Dec 2010 08:34:54 AM UTC, comment #2: 

Please, no. In the example of a dataframe, this is a collection of heterogenous data. So
zeros(1, 10, class('dataframe'))
doesn't make sense, as the type of the columns is not defined. Now, if x is a dataframe with one line and ten columns,
x(1, :) = 0
is defined, as subsasgn will iterate on columns, casting the RHS to the right internal type.

Regards

Pascal

Pascal Dupuis <cdemills>
Group Member
Wed 22 Dec 2010 08:17:53 AM UTC, comment #1: 

It seems that the simpler change of

retval = zeros (sz, class (x))

in place of

retval = zeros (sz)

also works, so I checked in that change instead.

John W. Eaton <jwe>
Group administrator
Fri 17 Dec 2010 03:01:49 PM UTC, original submission:  

The proposed patch is aimed at making skewness return something of the same class as the input. Provided all operations are overloaded, the type of the output is the same as the type of the input.

Pascal Dupuis <cdemills>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #22218:  skewness.m.diff added by cdemills (573B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by cdemills (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 logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-22 jwe StatusNone Done
        Open/ClosedOpen Closed
    2010-12-17 cdemills Attached File- Added skewness.m.diff, #22218

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code