bugGNU Octave - Bugs: bug #60089, the sparse QR factorizion does not...

 
 

bug #60089: the sparse QR factorizion does not give economy sized Q

Submitter:  Andreas Wachtel <awachtel>
Submitted:  Sun 21 Feb 2021 07:18:16 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  aWachtel Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 Feb 2021 07:04:08 AM UTC, comment #1: 

I can confirm that this is still an issue in Octave 6.2.0.

It seems to work as expected with a built from the development sources (which will eventually become Octave 7):

>> Z = [magic(3); speye(3)];
>> [Q, ~] = qr(Z, 0);
>> size(Q)
ans =

   6   3

>> [Q, ~] = qr(full(Z), 0);
>> size(Q)
ans =

   6   3


This is probably because starting in that version Octave's `qr` function will be using SPQR if available.

It is unlikely that that change will be backported to Octave 6 (because it would be quite disruptive and break the API).

Closing as fixed for Octave 7.

Markus Mützel <mmuetzel>
Group administrator
Sun 21 Feb 2021 07:18:16 PM UTC, original submission:  

according to the docs
  [...] = qr (..., 0)
If the final argument is the scalar 0 and the number of rows is larger than the number of columns, then an "economy" factorization is returned, omitting zeroes of R and the corresponding columns of Q.  That is, R will have only 'size (A,1)' rows.  In this case, P  is a vector rather than a matrix.


Z = [magic(3); speye(3)];
[Q,~] = qr(Z, 0);


I would expect 3 orthogonal columns, but I get 6, the full Q if you will. On the other hand, the following lines give 3 orthogonal columns.


Z = [magic(3); speye(3)];
[Q,~] = qr(full(Z), 0);


I was not sure how to classify this item, it is a consistency error in behavior rather than anything else.

Andreas Wachtel <awachtel>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by awachtel (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 group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-22 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed
        Release4.2.2 dev
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code