bugGNU Octave - Bugs: bug #60274, GSVD reordering (matlab...

 
 

bug #60274: GSVD reordering (matlab compatibility)

Submitted by:  Leonardo <pocker>
Submitted on:  Tue 23 Mar 2021 11:21:31 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev 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 23 Mar 2021 11:21:31 AM UTC, original submission:  

Hi.

The ordering of the elements in the output of gsvd is in reverse order compared to Matlab.

After commands

>> A = [1 1 3; 3 1 2; 2 1 1];
>> B = [2 0 1; 2 1 -1;1 0 0];
>> [U, V, X, C, S] = gsvd (A, B);
>> diag(C)

ans =

0.9968
0.6072
0.3022

while in matlab diag(C) produces 0.3022, 0.6072, 0.9968.

A simple workaround is

>> C = diag(flipud(diag(C)));
>> S = diag(flipud(diag(S)));
>> U = fliplr(U);
>> V = fliplr(V);
>> X = fliplr(X);


Side note: matrix X has wrong results. See bug #60273.
https://savannah.gnu.org/bugs/?60273

This affects, at least, v. 6.2.0 and 7.0.0 (4a516dce916c+). Both compiled from source, debian 10.

Kind regards,
Leonardo

Leonardo <pocker>

 

(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 pocker (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.6