bugGNU Octave - Bugs: bug #42177, Wrong second output argument for...

 
 

bug #42177: Wrong second output argument for chol of a sparse matrix

Submitter:  Marco Caliari <caliari>
Submitted:  Wed 23 Apr 2014 12:57:37 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Jan 2015 04:00:35 PM UTC, comment #4: 

I just noticed that, although not written in the help, for the full case it seems true that if info is not zero, then


R(1:info-1,1:info-1)'*R(1:info-1,1:info-1) == A(1:info-1,1:info-1)


(as written in Matlab help), whereas in the sparse case, if A is not SPD, than info is always 1. So, now it is a simpler not compatible behavior.

Marco

Marco Caliari <caliari>
Group Member
Thu 19 Jun 2014 05:01:24 PM UTC, comment #3: 

Fixed in this changeset on the stable branch (http://hg.savannah.gnu.org/hgweb/octave/rev/161b11e7da2d).

Rik <rik5>
Group administrator
Thu 24 Apr 2014 07:02:38 AM UTC, comment #2: 

Hi Mike,

the result from Matlab is R=[1,1] (as in octave), but info == 2.

The help (both in Octave and Matlab) clearly says that if A is not positive definite, then the second output argument is not 0 and this is a correct behavior in my opinion. One uses R = chol (A) if thinks A is SPD. If not, he should be warned. Then he can decide whether to use R or not.

What is misleading in the help of Octave is the use of P as second output argument. It seems a permutation matrix. Matlab uses p, but why not to use info?

Cheers,

Marco

Marco Caliari <caliari>
Group Member
Wed 23 Apr 2014 11:00:03 PM UTC, comment #1: 

Confirmed. Although the help and the different calling conventions for this function seem somewhat convoluted, so I can't say whether it's correct or not. Some samples from Matlab to confirm the correct behavior might be nice.

For example, with sparse input it does return an R such that R'*R == A. Should p be non-zero only when R'*R != A, or when R is not n-by-n and upper triangular? Neither the Octave nor Matlab help descriptions are clear or in agreement about this, at least what I get out of reading them.

Mike Miller <mtmiller>
Group Member
Wed 23 Apr 2014 12:57:37 PM UTC, original submission:  

Dear all,

if you try


[R, info] = chol ([1, 1; 1, 1])


you correctly get info = 2 (the matrix is not SPD), but


[R, info] = chol (sparse ([1, 1; 1, 1]))


gives back info = 0.

Cheers,

Marco

Marco Caliari <caliari>
Group Member

 

(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)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by caliari (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-30 caliari Item GroupIncorrect Result Matlab Compatibility
    2014-06-19 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2014-04-23 mtmiller Item GroupNone Incorrect Result
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code