Dirk Eddelbuettel —
written Jan 18, 2013 —
updated Nov 23, 2015 —
source

Two previous posts showed how to compute eigenvalues
using Armadillo and
using Eigen. As we have also looked at using the GNU GSL, this post will show how to
conpute eigenvalues using GSL.

As mentioned in the previous GSL post, we
instantiate C language pointers suitable for GSL (here the matrix
M). Prior to release 0.3.0 of RcppGSL, these had to be freed manually.
However, since release 0.3.0 since is now taken care of via the standard
C++ mechanism of destructors.

We can illustrate this easily via a random sample matrix.

[1] 14.210011 2.409920 1.685588 0.331887

In comparison, R gets the same results (in reverse order) and also returns the eigenvectors.