[R] R crashes during 'eigen'

Simon Wood sw283 at maths.bath.ac.uk
Thu Mar 30 12:40:26 CEST 2006


> Seems quite a bad story to me at the moment.
> I assume that octave (or matlab) which are also based on BLAS +
> LAPACK internally can eigen-decompose the matrix correctly?
> Could anyone check this (without much effort) for us?

Not quite what you asked for, but the following works....

library(mgcv)
M <- as.matrix(read.table("thematrix",header=T))
n <- nrow(M)
d <- array(0,n)
um<-.C("mgcv_symeig",as.double(M),as.double(d),as.integer(n),PACKAGE="mgcv")
um[[2]] ## the eigenvalues

... it's directly calling `dsyevd' from lapack as supplied with R. i.e.
it's using lapack + blas from R. This is on R-devel suse linux 9.3
pentium xeon. eigen(M) hangs on the same platform.

However `dsyevd' isn't the routine called by `eigen'... it uses `dsyevr'
instead (the freeze occurs when this calls DSTEGR). Apparently the
difference is that `dsyevr' uses a `Relatively Robust Representation'
[perhaps `relatively robust' is not roust enough in this case :-)]


Simon

>- Simon Wood, Mathematical Sciences, University of Bath, Bath BA2 7AY
>-             +44 (0)1225 386603         www.maths.bath.ac.uk/~sw283/




More information about the R-help mailing list