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

 
 

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

Submitter:  None
Submitted:  Thu 06 Jul 2017 10:51:30 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Harry Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Closing as fixed in 4.2.1.

Markus Mützel <mmuetzel>
Group administrator
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



A = [1,1+1j;1-1j,3];
>> inv(A)
ans =

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

>> inv(ans)
ans =

   1.0000 + 0.0000i   1.0000 + 1.0000i
   1.0000 - 1.0000i   3.0000 - 0.0000i

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-06 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed
        Release4.2.0 4.2.1

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code