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

 
 

bug #46316: kron changes class to double

Submitted by:  None
Submitted on:  Wed 28 Oct 2015 04:22:51 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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,

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

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

Rik <rik5>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

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

    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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Nov 2016 05:27:14 AM UTCrik5Release4.0.0=>dev
      Operating SystemMicrosoft Windows=>Any
    Thu 29 Oct 2015 03:22:51 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1