octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47236] output of eigs() with 'sa' option diff


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #47236] output of eigs() with 'sa' option differs from Matlab
Date: Tue, 23 Feb 2016 19:58:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0 Iceweasel/44.0.2

Follow-up Comment #6, bug #47236 (project octave):

Can you show what the results are and what they should be? I'm assuming it's
the sort order of the d diagonal matrix, but the values are correct?


octave:1> load yaledata 
octave:2> L = diag (sum (A)) - A;
octave:3> [v, m] = eigs (A, 3, "sa"); diag (m), eig (A)(1:3)
ans =

  -3.5256
  -3.5358
  -3.9126

ans =

  -3.9126
  -3.5358
  -3.5256

octave:4> [v, d] = eigs (L, 3, "sa"); diag (d), eig (L)(1:3)
ans =

   2.5453e-02
   2.0710e-02
   2.9696e-15

ans =

   3.0197e-14
   2.0710e-02
   2.5453e-02




Note that even Matlab's help for eigs claims that "eigs does not always return
sorted eigenvalues and eigenvectors. Use sort to explicitly sort the output
eigenvalues and eigenvectors in cases where their order is important." (from
https://www.mathworks.com/help/matlab/ref/eigs.html)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47236>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]