bugGNU Octave - Bugs: bug #43875, warning: matrix singular to...

 
 

bug #43875: warning: matrix singular to machine precision for triangular matrices

Submitter:  Marco Caliari <caliari>
Submitted:  Tue 23 Dec 2014 01:55:50 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.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Jan 2015 09:55:01 AM UTC, comment #5: 

Matlab prints the warning for every left division with A. The trivial case 0 \ 1 always prints the warning "division by zero" in Octave and never in Matlab. I vote for always printing the warning.

Marco Caliari <caliari>
Group Member
Tue 27 Jan 2015 02:46:41 PM UTC, comment #4: 

Yes, initially the matrix type is "Full" but after the first pass through Matrix::fsolve it is set to "Rectangular".  From then on, the logic in Matrix::solve dispatches directly to lssolve instead of first going through Matrix::fsolve.  Should we do something different there?

John W. Eaton <jwe>
Group administrator
Fri 02 Jan 2015 05:32:02 PM UTC, comment #3: 

Seems to work, although there is one oddity.  The warning about the matrix being singular is printed out just once for the initial matrix A.  Subsequent left divisions do not produce another warning.  On the other hand, every left division of the U matrix produces a warning.  This is probably something to do with the matrix type caching.


octave:1> A = [1,2,3;4,5,6;7,8,9];
octave:2> A \ ones (3,1);
warning: matrix singular to machine precision, rcond = 1.54198e-18
octave:3> A \ ones (3,1);
octave:4> A \ ones (3,1);
octave:5> [L,U] = lu (A);
octave:6> U \ ones (3,1);
warning: matrix singular to machine precision, rcond = 2.59052e-18
octave:7> U \ ones (3,1);
warning: matrix singular to machine precision, rcond = 2.59052e-18
octave:8> U \ ones (3,1);
warning: matrix singular to machine precision, rcond = 2.59052e-18



Rik <rik5>
Group administrator
Sun 28 Dec 2014 02:41:21 AM UTC, comment #2: 
John W. Eaton <jwe>
Group administrator
Fri 26 Dec 2014 07:37:05 PM UTC, comment #1: 

I think the attachec patch should solve this problem.  I'm not sure why calc_cond was set to false for these function calls but not the normal full solver.


(file #32718)

John W. Eaton <jwe>
Group administrator
Tue 23 Dec 2014 01:55:50 PM UTC, original submission:  

Dear all,

if I try to solve the system


A = [1,2,3;4,5,6;7,8,9]; A \ ones(3,1)


I get the warning about the singularity of the matrix (rcond  = 1.54e-18). If I take the U of its LU factorization [L, U] = lu(A) and the same rhs, I get no warning, although rcond (U) = 2.59e-18.
Is this desired? Matlab gives the warning in both cases.

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:
   

Attached Files
file #32718:  diffs.txt added by jwe (4KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Updated the item)
  • -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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-27 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2014-12-30 rik5 StatusNone Ready For Test
    2014-12-26 jwe Attached File- Added diffs.txt, #32718

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code