eigenvalues of a circulant matrix
Under Linux run "ldd" on the binary to see what shared libraries the binary has been linked against and will attempt to load. The command you run is a shell script which sets and exports LD_LIBRARY_PATH and then runs R, so to be sure first start R and execute
system("echo $LD_LIBRARY_PATH")
and then using this value for LD_LIBRARY_PATH do
$ export LD_LIBRARY_PATH=<R's value for this>
$ ldd `R RHOME`/bin/exec/R
which will list the shared libraries R will try to load to resolve links to
shared libraries.
Having said that, I have tried your example on several platforms with
several configurations, and I get NaNs only when R is calling the Lapack
routine dsyevr (R's builtin Lapack) with an external (optimized) blas
(either Goto or ATLAS's blas) but not R's builtin blas. Moreover even with
the optimized blas, if I use dysev instead of dsyevr, (eigen() executes a
.Call("La_rs",x,only.values,"dsyevr",PACKAGE="base"), I execute this from R
with "dsyev" in place of "dsyevr") I get no NaNs.
So it looks like a problem with a blas routine used by dsyevr but not dsyev,
but I have yet to confirm.
I note that your C program does not use either of these lapack routines.
Reid Huntsinger
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Globe Trotter
Sent: Tuesday, May 03, 2005 12:21 PM
To: Huntsinger, Reid; r-help at stat.math.ethz.ch
Subject: RE: [R] eigenvalues of a circulant matrix
Hi,
The R was downloaded in binary form (Fedora Core 3 RPM) from a CRAN mirror.
I
do not know which LAPACK it links to, but the only LAPACK on my machine is
lapack-3.0-28 (RPM installation). How does one figure out which BLAS or
whether
it is threaded?
Many thanks and best wishes!
--- "Huntsinger, Reid" <reid_huntsinger at merck.com> wrote:
How was your R 2.0.1 built? Which Lapack did it link to, and which one
does
it load? Which BLAS? Is the BLAS threaded? Does it link to the optimized pthreads library? Etc. (I'm not a Fedora Core 3 user so I'm not sure what the default setup is, and of course I don't know if that's what you have.)
As I pointed out in my previous post, in eigen() the matrix is "inspected for symmetry" so symmetric=TRUE is the same as not specifying this at all. You could try symmetric=FALSE... Reid Huntsinger -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Globe Trotter Sent: Monday, May 02, 2005 10:51 PM To: r-help at stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv
used
to
create my circulant matrix, using the following commands:
x<-scan("kinv")
y<-x[c(109:1,0:108)]
X=toeplitz(y)
eigen(X)
write(X,ncol=216,file="test.dat")
reports the following columns full of NaN's: 18, 58, 194, 200. (Note that
eigen(X,symmetric=T) makes no difference and I get the same as above).
The second attachment contains only the eigenvectors obtained on calling a
LAPACK routine directly (from C). The eigenvalues are essentially the same
as
that obtained using R. Here, I use the LAPACK-recommended double precision
routine dspevd() routine for symmetric matrices in packed storage format.
Note
the absence of the NaN's....I would be happy to send my C programs to
whoever
is interested.
I am using
:~> uname -a
Linux 2.6.11-1.14_FC3 #1 Thu Apr 7 19:23:49 EDT 2005 i686 i686 i386
GNU/Linux
and R.2.0.1.
Many thanks and best wishes!
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
---------------------------------------------------------------------------- --
Notice: This e-mail message, together with any attachment...{{dropped}}
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html