bugGNU Octave - Bugs: bug #41065, Single precision matrix inverse...

 
 

bug #41065: Single precision matrix inverse gives bogus singular matrix warning

Submitted by:  None
Submitted on:  Thu 02 Jan 2014 02:25:17 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Jordi Gutiérrez Hermoso <jordigh>
Originator Name: Zsbán AmbrusOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 08 Jan 2014 03:11:14 AM UTC, comment #5:

Thinking about this a little more, I'm not sure the fix is the right thing to do. We want to test rcond+1 == 1 but in float precision for floats and double precision for doubles. What we are doing instead is always doing the test as a double. I think that's wrong. For example:

I also think this is worth applying to stable. It seems bad if Octave can't even invert a simple float matrix without issuing a warning. I checked in the following change on stable and merged it with gui-release and default:

http://hg.savannah.gnu.org/hgweb/octave/rev/36057e2411f8

John W. Eaton <jwe>
Project Administrator
Tue 07 Jan 2014 11:17:14 PM UTC, comment #4:

The patch looked good so I committed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/c0f036b5e292). Closing report.

Rik <rik5>
Project Administrator
Thu 02 Jan 2014 03:52:55 PM UTC, comment #3:

Thank you for the patch Jordi, works perfect for me.

>> inv (single (eye (3) + 0))

ans =

1 -0 -0
0 1 -0
0 0 1

No warnings occur.

Kai Torben Ohlhus <siko1056>
Project Member
Thu 02 Jan 2014 03:13:40 PM UTC, comment #2:

Does this proposed patch fix the problem?

(file #30148)

Jordi Gutiérrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Thu 02 Jan 2014 02:36:22 PM UTC, comment #1:

This bug can be reproduced in the current development version too.

>> ver

----------------------------------------------------------------------
GNU Octave Version 4.1.0+
GNU Octave License: GNU General Public License
Operating System: Linux 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64
----------------------------------------------------------------------
no packages installed.

>> inv(single(1))

warning: inverse: matrix singular to machine precision, rcond = 0
ans = 1

Kai Torben Ohlhus <siko1056>
Project Member
Thu 02 Jan 2014 02:25:17 PM UTC, original submission:

Dear octave devs,

It appears that the inv function can give a bogus warning about the input being a singular matrix even when I use a single precision matrix that is very far from singular. The resulting inverse matrix I get seems to be correct, only the warning is wrong.

Here is a transcript for the bug.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #30148:  inv.patch added by jordigh (734B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by siko1056 (Posted a comment)
  • -unavailable- added by None (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 07 Jan 2014 11:17:14 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Thu 02 Jan 2014 03:13:40 PM UTCjordighAttached File-=>Added inv.patch, #30148
      StatusConfirmed=>Patch Submitted
      Assigned toNone=>jordigh
    Thu 02 Jan 2014 02:40:32 PM UTCmtmillerStatusNone=>Confirmed
      Release3.6.2=>dev
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1