Skip to content

eigenvalues of a circulant matrix

2 messages · Huntsinger, Reid, Globe Trotter

#
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
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:
does
used
----------------------------------------------------------------------------
--
______________________________________________
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
#
--- "Huntsinger, Reid" <reid_huntsinger at merck.com> wrote:

            
/usr/lib/R/lib:/usr/local/lib:/usr/X11R6/lib:/usr/local/lib
I use tcsh, so had to switch to bash to use export....
libblas.so.3 => /usr/lib/libblas.so.3 (0x00995000)
        libg2c.so.0 => /usr/lib/libg2c.so.0 (0x0068f000)
        libm.so.6 => /lib/tls/libm.so.6 (0x00664000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00dd1000)
        libreadline.so.4 => /usr/lib/libreadline.so.4 (0x00d3d000)
        libncurses.so.5 => /usr/lib/libncurses.so.5 (0x03d2f000)
        libdl.so.2 => /lib/libdl.so.2 (0x00689000)
        libc.so.6 => /lib/tls/libc.so.6 (0x00538000)
        /lib/ld-linux.so.2 (0x0051e000)
Well, I have now written a test function in C to call dsyevr, but it goes
through fine -- no NaN's. (I can send the test function).

I wonder if there is an issue with workspace allocation in R: dsyevr has an
optimal way of doing that, and that is obtained by a call with iwork=-1. 

Many thanks and best wishes!