Re: [eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver? |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver?*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Thu, 29 Sep 2016 15:35:26 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=yQQN0UAfO4ci+Hc/PI2FNWuYMh6qi/PPNC/QC9YLUBw=; b=Kt0CBHdtgPm3awZ1scYe0VqX5VOQK/D9Sev2r8BN/8R5LJvOmHc1Fek3r0B02m9kE/ s2mCy7P7MDQylgToTnBNJpsTnFu+/blU62n2aGhCO4B27tQTdEnChFVxRI8EBWHXRDw1 dsG+JRmsfGiT/+i1LA7Yf6YyhUbsm4GXZfLL8vbEUnjCh6ThR0eFWAmaq4gl1EuwVZ85 /zSShgXQ91L7XUIdyxk9+wzE3QSsDohIuncfUBy1tItPQxOvagaH0Xj/xqcwh0yy+wyd Z6DzlzXjNoFEw+sv8wbBn5TiFZU1LKMbbwd4gsqv5Qchpl2ic3ksUZHkf/kqOGFHwlTN 0g1A==

For SelfAdjointEigenSolver, the eigenvalues are always real, and they are always sorted from the smallest to the largest. On the other hand, for the general EigenSolver, the eigenvalues can be complex and there is no natural ordering for them. The output is thus the raw outcome of performing the Hessenberg decomposition followed by implicit QR iterations. If the input matrix is diagonal, then the order won't change. Otherwise, there is no such notion of "same ordering".

gael

On Thu, Sep 29, 2016 at 3:03 PM, William Oquendo <woquendo@xxxxxxxxx> wrote:

Dear all,I am performing some simulations where I need to compute the eigenvalues of the stress tensor of the 3D system, represented by a 3x3 matrix. The way the matrix is constructed implies that, for example, the first value (matrix[0][0]) is associtaed with the x direction, while the last element matrix[2][2] is associated with the z direction. In the same way, it is expected, for example, that the last eigen value will be associtaed with the z direction.. The matrix is Self Adjoint.I would like to know if there is a guaranteed that the latest eigenvalue returned by eigensolver.eigenvalues() will always correspond to the same eigenvector, or if the eigensolver will return the eigen values permuted in some way. I have just tested (see code at the end) with some random matrices and diagonal matrices and it seems that I always get the same ordering, but if I use the SelfAdjoint solver then the order changes. If I repeat the computation with the general or the SelfAdjoint version I get the same output for each method, although the ordering differes between them.I need to confirm the ordegring, since I need to perform some computations which depends strongly on the relative value of the first eigen value (x value) compared with the latest one (z value).Thanks in advance.#include <iostream>#include <Eigen/Dense>using namespace std;using namespace Eigen;int main(){Matrix3f A;A << 1, 0, -1, 0, 2, 0, -1, 0, 3;cout << "Here is the matrix A:\n" << A << endl;EigenSolver<Matrix3f> eigensolver(A);//SelfAdjointEigenSolver<Matrix3f> eigensolver(A); // this changes the order if (eigensolver.info() != Success) abort();cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << endl;cout << "Here's a matrix whose columns are eigenvectors of A \n"<< "corresponding to these eigenvalues:\n"<< eigensolver.eigenvectors() << endl;}--

Best regards / Cordialmente,William-Fernando Oquendo--------------------------Este correo puede carecer de tildes o eñes debido al teclado.

**Follow-Ups**:

**References**:

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver?** - Next by Date:
**Re: [eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver?** - Previous by thread:
**[eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver?** - Next by thread:
**Re: [eigen] Is there any guarantee regaridng the order of the eigenvalues for the EigenSolver?**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |