Mo Valipour
Mo Valipour

Reputation: 13496

Solving Eigen System in c#?

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

Answers (3)

Mo Valipour
Mo Valipour

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:

enter image description here

Upvotes: 2

Alexandre C.
Alexandre C.

Reputation: 56976

Alglib is GPL2.

Upvotes: 5

duffymo
duffymo

Reputation: 308988

Maybe this library can help you.

Upvotes: 5

Related Questions