Finding the orthogonal basis of a symmetric matrix in c++

Viewed 215

I want to find an eigendecomposition of a symmetric matrix, which looks for example like this:

0 2 2 0
2 0 0 2
2 0 0 2
0 2 2 0

It has a degenerate eigenspace in which you obviously have a certain freedom to chose the eigenvectors. Is there a library for c++ which I can force to find the Orthogonal Basis such that H = UDU^{T}?

Currently I'm using the Eigen::SelfAdjointEigenSolver. This gives the "wrong" result as then I have to use H = UDU^{-1}. The Matrices will have dimensions of 10000x10000 later on, because of this I want to omit the additional inversion of the matrix.

Does anyone know of such a thing?

1 Answers

OpenCV has support for this. Though, I don't know if you can use it on matrix 10000x10000 within suitable time/accuracy. I believe the best fit in OpenCV is eigen(...) method.

There is also BLAS C++ linear algebra library but I am not familiar with it.

Also, there is probably an implemetarion of an algorithm for this problem in the book Numerical Recipes.

Related