Serving the Quantitative Finance Community

 
User avatar
Actuary321
Topic Author
Posts: 0
Joined: November 24th, 2009, 12:35 pm

Eigenvalue in C++

February 10th, 2011, 11:52 am

Hi,I need to calculate the eigenvalue of a matrice using c++. I have visual studio 2008 express. Does Boost have this function, or are there some libraries with this function available that anyone has used. Has anyone done this in c++ before.The matrices are large ~40 rows x 40 columns.Thanks!
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Eigenvalue in C++

February 10th, 2011, 11:57 am

Boost has matrices, but no eigen stuff. However, this might be Ok (I have not tried it myself).alglib
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Eigenvalue in C++

February 10th, 2011, 12:07 pm

I used this in uni: http://www.robertnz.net/nm11.htmI've also heard good things about this one: http://math.nist.gov/tnt/
 
User avatar
FaridMoussaoui
Posts: 327
Joined: June 20th, 2008, 10:05 am
Location: Genève, Genf, Ginevra, Geneva

Eigenvalue in C++

February 10th, 2011, 1:08 pm

ARPACK (in Fortran) and Arpack++ (offers c++ programmers an interface to ARPACK) are your friends.The "best" known eigenvalue package.Farid.
 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

Eigenvalue in C++

February 10th, 2011, 1:29 pm

You can write eigenvalue algo in terms of BLAS calls. It is a good exercise. Boost has uBlas, which is C++ implementation of BLAS interface.
Last edited by renorm on February 9th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
Actuary321
Topic Author
Posts: 0
Joined: November 24th, 2009, 12:35 pm

Eigenvalue in C++

February 10th, 2011, 1:47 pm

Thanks for the links, I will check them out.
 
User avatar
quantmeh
Posts: 0
Joined: April 6th, 2007, 1:39 pm

Eigenvalue in C++

February 10th, 2011, 1:48 pm

40x40 is not a large matrix. i used once GSL, it's very easy to setup and link, try it
 
User avatar
kimosabe
Posts: 4
Joined: November 25th, 2003, 12:24 pm

Eigenvalue in C++

February 10th, 2011, 5:06 pm

When Baugh first reported to the Redskins for practice, he had a meeting with coach Ray Flaherty and had an exchange that reportedly went something like this: ?They tell me you?re quite a passer,? said Flaherty, handing Baugh a football. ?I reckon I can throw,? Baugh answered. ?Let?s see it. Hit that receiver in the eye,? said Flaherty, pointing to a man running down the field. ?Which eye?? said BaughThe Big Boys use LAPACK to compute eigenvalues, but you have to know what you are doing to use it. Is the matrix symmetric, tridiagonal, banded, etc?You can get LAPACK libraries by installing MKL from http://software.intel.com/en-us/articles/intel-mkl/. Here is how to call the routine for symmetric matrices. It will work out of the box with the xll library, but calling from straight C is very similar. For VC++ add the following under Properties|Linker|Input Additional Dependencies: mkl_intel_c.lib;mkl_core.lib;mkl_intel_thread.lib;libguide.lib; You also have to set the directories for the MKL headers and libraries.