bugGNU Octave - Bugs: bug #51401, inv() function gives incorrect...

 
 

bug #51401: inv() function gives incorrect results, even for invertible 2x2 matrix

Submitted by:  None
Submitted on:  Thu 06 Jul 2017 10:51:30 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: HarryOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 06 Jul 2017 12:38:51 PM UTC, comment #3:

Closing as fixed in 4.2.1.

Markus Mützel <mmuetzel>
Project Member
Thu 06 Jul 2017 11:30:44 AM UTC, comment #2:

I have downloaded 4.2.1 for Windows and the behaviour is indeed correct.

This is not a bug in 4.2.1.

Anonymous
Thu 06 Jul 2017 11:24:36 AM UTC, comment #1:

on ubuntu and octave 4.2.1 fecca33388f747

I get

Doug Stewart <dastew>
Thu 06 Jul 2017 10:51:30 AM UTC, original submission:

There is a clear bug in the inv() function, which I particularly see for Hermitian matrices.

Example:

A = [1,1+1j;1-1j,3];

>> inv(A)

ans =

3 + 0i -1 - 1i
-1 - 1i 1 + 0i

The correct answer should be:
ans =

3 + 0i -1 - 1i
-1 + 1i 1 + 0i

(i.e. ans(2,1) is conjugated). Matlab gives the correct answer. Or for a 2x2 matrix, we can check it as:

detA = A(1,1)A(2,2) - A(1,2)A(2,1);
invA = [A(2,2),-A(1,2); -A(2,1),A(1,1)] / detA;

Anonymous

 

(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 mmuetzel (Posted a comment)
  • -unavailable- added by dastew (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 06 Jul 2017 12:38:51 PM UTCmmuetzelStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release4.2.0=>4.2.1

    Back to the top


    Powered by Savane 3.1-cleanup1