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

 
 

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

Submitted by:  Marco Caliari <caliari>
Submitted on:  Wed 23 Apr 2014 12:57:37 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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

(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>
Project 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>
Project 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>
Project 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>
Project Administrator
Wed 23 Apr 2014 12:57:37 PM UTC, original submission:

Dear all,

if you try

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

gives back info = 0.

Cheers,

Marco

Marco Caliari <caliari>
Project Member

 

(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)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by caliari (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Jan 2015 04:00:35 PM UTCcaliariItem GroupIncorrect Result=>Matlab Compatibility
    Thu 19 Jun 2014 05:01:24 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Wed 23 Apr 2014 11:00:03 PM UTCmtmillerItem GroupNone=>Incorrect Result
      StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1