bugGNU Octave - Bugs: bug #46316, kron changes class to double

 
 

bug #46316: kron changes class to double

Submitter:  None
Submitted:  Wed 28 Oct 2015 04:22:51 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 02 Sep 2017 01:16:38 PM UTC, comment #3: 

What happens if the two arguments to kron are of different integer types?  For example,


x = kron(uint8[2 3;4 5], ones(2,2,'int16'))
class (x)



Rik <rik5>
Group administrator
Wed 23 Nov 2016 05:27:14 AM UTC, comment #2: 

Still present on the dev branch (11/22/16).

Rik <rik5>
Group administrator
Thu 29 Oct 2015 03:22:51 PM UTC, comment #1: 

Confirmed.  The code for this is in libinterp/corefcn/kron.cc.  In the function dispatch_kron() there is a long if/else tree that checks whether the inputs are diagonal matrices, permutation matrices, single matrice, or sparse matrices.  If it is none of the above it assumes a double matrix and proceeds with the calculation.

Clearly the integer case needs to be added.

Rik <rik5>
Group administrator
Wed 28 Oct 2015 04:22:51 PM UTC, original submission:  

I was expecting kron() to return the output of unchanged class if the inputs are of the same class. For example:

kron(uint8[2 3;4 5], ones(2,2,'uint8'))

returns a 4x4 double matrix instead of uint8.

Anonymous

 

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

    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-11-23 rik5 Release4.0.0 dev
        Operating SystemMicrosoft Windows Any
    2015-10-29 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code