How to get original order of eigenvalues using Eigen?
<p>I have a diagonal matrix with eigenvalues e.g. 1, 2 and 3. I disturb its values with some noise but it is small enough to change the sequence. When I obtain the eigenvalues of this matrix they are 1,2,3 in 50% cases and 1,3,2 in another 50%. 
When I do the same thing without the noise the order is always 1,2,3. </p>

<p>I obtain the eigenvalues using:</p>

<pre><code>matrix.eigenvalues().real();
</code></pre>

<p>or using:</p>

<pre><code>Eigen::EigenSolver&lt;Eigen::Matrix3d&gt; es(matrix, false);
es.eigenvalues().real();
</code></pre>

<p>The result is the same. Any ideas how to fix it? </p>