Reputation: 13496
Do you know of a good library/way that I can use to solve an eigen system in c#?
My data is 2D/3D and I want to get direction and length of first and second eigen vectors to evaluate how my data is elongated in 2D space.
Thanks
Upvotes: 4
Views: 5000
Reputation: 13496
Thanks to guys who suggested Alglib but its naming convention is c++ style and I didn't find it easy to use!
Instead I found a brilliant opensource library called Accord.Math. It provides a fantastic API for mathematics which very well satisfies my needs.
I first found a Normalized EigenValue decomposition code here, but apparently it is already added to Accord.Math library.
My code looks like this:
var gevd = new EigenvalueDecomposition(rect);
var V = gevd.Eigenvectors;
var D = gevd.DiagonalMatrix;
It also provides other types of decompositions:
Upvotes: 2