CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    3

    Eigenvalues and Eigenvectors Calculation

    Hi,

    I'm doing a project for computers class in C#.

    In that project I need to calculate the eigenvalues and eigenvectors of a square matrix.

    Does someone have an algorithm for that?

    Yuval Lewi

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,448

    Re: Eigenvalues and Eigenvectors Calculation

    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Feb 2011
    Location
    United States
    Posts
    954

    Re: Eigenvalues and Eigenvectors Calculation

    I recommend the QR algorithm: http://en.wikipedia.org/wiki/QR_algorithm

    Calculating eigenvalues programatically is a bit mathematically complicated though, so ... hang on to your hat.

    To be honest, if you don't HAVE to write your own algorithm to do it, I would try to find some good numerical software that can do it (you can even find some libraries with C# wrappers).

    Good luck!
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    954

    Re: Eigenvalues and Eigenvectors Calculation

    Hate to bring up such an old post, but in case it should be useful to those searching the archive: The Math.NET Numerics package (see http://numerics.mathdotnet.com/) has an eigensolver that is relatively easy to call and use. However, I seem to think it was taking a long time on very large sparse matrices (compared to the Octave [Matlab clone] eigensolver on the same matrix). However, for moderate-size dense (or sparse) matrices, it worked just fine. I haven't been able to find C# code that was good for large, sparse matrices. Presumably, such a thing would be a port of ARPACK, but I have had no luck finding a library like that.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width