bugGNU Octave - Bugs: bug #45511, eig() sometimes accepts second...

 
 

bug #45511: eig() sometimes accepts second matrix without using it

Submitter:  None
Submitted:  Thu 09 Jul 2015 09:21:51 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 15 Sep 2015 12:56:43 PM UTC, comment #5: 

Finally pushed the fix for this one to the default branch, sorry about losing track of this one:

http://hg.savannah.gnu.org/hgweb/octave/rev/ff904ae0285b

Mike Miller <mtmiller>
Group Member
Fri 10 Jul 2015 06:53:04 PM UTC, comment #4: 

Mike,

I checked that with your patch the originally submitted bug is fixed and the following test passes


A=[1,1+1i;1-1i,1];,B=[2,0;0,2];[V,D]=eig(A,B);assert(A*V-B*V*D,zeros(2),1e-15)


while it fails on my (original) 3.8.2.

Marco

Marco Caliari <caliari>
Group Member
Fri 10 Jul 2015 04:38:21 PM UTC, comment #3: 

Yep, I think Marco nailed it. The floating point version also needs to be fixed. Can you test the attached diff? Needs test cases added preferably before pushing.

(file #34414)

Mike Miller <mtmiller>
Group Member
Fri 10 Jul 2015 04:29:34 PM UTC, comment #2: 

A poster at the thread I mentioned (http://stackoverflow.com/questions/31327630/scipy-linalg-eig-giving-different-eigenvectors-from-gnu-octaves-eig) noticed that this problem only occurs if the M matrix is diagonal.

Anonymous
Fri 10 Jul 2015 08:19:52 AM UTC, comment #1: 

I guess the problem is at line 718 of EIG.cc. It should be


if (a.is_hermitian () && b.is_hermitian () && info == 0)
  return hermitian_init (a, b, calc_ev);


Marco

Marco Caliari <caliari>
Group Member
Thu 09 Jul 2015 09:21:51 PM UTC, original submission:  

Sometimes, [V,D]=eig(K,M) solves the generalized eigenvalue equation lambda M v = K * v, but other times it doesn't.

For example, for K = [1 2; 3 4], M = [5 6; 7 8] it seems to work, and we get two different answers for eig(K) vs. eig(K,M).

However, for
K =
1.8000 + 0.0000i  -1.0970 + 0.9550i
  -1.0970 - 0.9550i   1.8000 + 0.0000i
and
M =
209     0
     0   209
eig(K,M) gives the same answer as eig(K), which is incorrect.

(I also posted the issue here: http://stackoverflow.com/questions/31327630/scipy-linalg-eig-giving-different-eigenvectors-from-gnu-octaves-eig.)

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #34414:  eig.diff added by mtmiller (940B - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-09 rik5 Dependencies- bugs #47095 is dependent
    2015-09-15 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2015-07-10 mtmiller Attached File- Added eig.diff, #34414
        Release3.8.2 dev
        Operating SystemMac OS Any

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code