Re: [eigen] inconsistency in fast eigen decomposition

```Gael, Benoit,

Many thanks for the prompt replies.

On 02/03/2011 02:29 AM, Gael Guennebaud wrote:
```
```Hi,

indeed, the code to extract the eigen vectors was quite naive. I've
committed a more accurate version which should work fine for most use
cases.
```
```
Thanks, I'll pick it up from bench/eig33.cpp again. :)

Cheers,
--
http://pointclouds.org

```
```
I assume you are doing planar fit right? If so then the new version
should really really be enough for you. It lacks some accuracy (but
not too bad) only when all eigenvalues are relatively closed to each
other. In this case there is no good planar approximation anyway.

gael

On Thu, Feb 3, 2011 at 7:41 AM, Radu Bogdan Rusu<rusu@xxxxxxxxxxxxxxxx>  wrote:
```
```Hi all,

Gael, we've been using the fast eigen decomposition suggested by you in an
e-mail back in 09/02/10 (regarding SelfAdjointEigenSolver<Matrix3f>  -
http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2010/08/msg00283.html)
without any major issues for the past few months.

We've recently hit a problem, and I was wondering whether there is a fix for
it that doesn't involve switching to another SVD/eigendecomposition method
in Eigen, as the implementation that we're using (see attached source) is
still blazing fast.

Here's the snippet of code that exhibits the problem (not that it's a c&p so

Eigen3::Matrix3f covariance_matrix_f;
covariance_matrix_f<<  5.64909, 5.64909, 0.0860435, 5.64909, 5.64909,
0.0860435, 0.0860435, 0.0860435, 2.92133;

(covariance_matrix_f);
Eigen3::Vector3f eigen_values = ei_symm.eigenvalues ();
Eigen3::Matrix3f eigen_vectors = ei_symm.eigenvectors ();

cerr<<  eigen_vectors<<  endl;
cerr<<  eigen_values<<  endl;
cerr<<  "Normal: "<<  eigen_vectors (0, 0)<<  ", "<<  eigen_vectors (1, 0)
<<  ", "<<  eigen_vectors (2, 0)<<  endl;

Eigen3::Vector3f eigen_val;
Eigen3::Matrix3f eigen_vec;
eigen33 (covariance_matrix_f, eigen_vec, eigen_val);

cerr<<  eigen_vec<<  endl;
cerr<<  eigen_val<<  endl;
cerr<<  "Normal: "<<  eigen_vec (0, 0)<<  ", "<<  eigen_vec (1, 0)<<  ","
<<  eigen_vec (2, 0)<<  endl;
----

The output is:

0.707107 -0.0102705   0.707032
-0.707107 -0.0102656   0.707032
3.48268e-06   0.999894  0.0145212
3.41638e-08
2.91956
11.2999
Normal: 0.707107, -0.707107, 3.48268e-06

-0.00781202 0.0102683  0.707032
-0.00781202 0.0102683  0.707032
0.999939 -0.999895 0.0145207
-1.01014e-06
2.91956
11.2999
Normal: -0.00781202, -0.00781202, 0.999939
---

Cheers,
--
http://pointclouds.org

```
```

```
```
```

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