Incidentally, if you want to test this out: > A [,1] [,2] [,3] [1,] 1457.738 1053.181 1256.953 [2,] 1053.181 1213.728 1302.838 [3,] 1256.953 1302.838 1428.269
> B [,1] [,2] [,3] [1,] 4806.033 1767.480 2622.744 [2,] 1767.480 3353.603 3259.680 [3,] 2622.744 3259.680 3476.790 I THINK this is correct for the other parameters: JOBVL="N" JOBVR="N" N=dim(A)[[1]] LDA=N LDB=N LDVL=N LDVR=N LWORK=max(1,8*N) .Call("La_dgeev", JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR=NA, ALPHAI=NA, BETA=NA, VL=NA, LDVL, VR=NA, LDVR, WORK=NA, LWORK, INFO=NA, PACKAGE="base") LAPACK's documentation is: http://www.netlib.org/lapack/double/dggev.f --j On Fri, Apr 20, 2012 at 11:58 AM, Jonathan Greenberg <j...@illinois.edu>wrote: > So I am a complete noob at doing this type of linking. When I write this > statement (all the input values are assigned, but I have to confess I don't > know what to do with the output variables -- in this call they are all > assigned "NA"): > > .Call("La_dgeev", JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR=NA, ALPHAI=NA, > BETA=NA, > + VL=NA, LDVL, VR=NA, LDVR, WORK=NA, LWORK, INFO=NA, PACKAGE="base") > > I get: > > Error in .Call("La_dgeev", JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR = NA, > : > C symbol name "La_dgeev" not in DLL for package "base" > > I'm running this on Windows 7 x64 version of R 2.14.2. The R_ext/Lapack.h > file states: > > /* DGEEV - compute for an N-by-N real nonsymmetric matrix A, the */ > /* eigenvalues and, optionally, the left and/or right eigenvectors */ > La_extern void > F77_NAME(dgeev)(const char* jobvl, const char* jobvr, > const int* n, double* a, const int* lda, > double* wr, double* wi, double* vl, const int* ldvl, > double* vr, const int* ldvr, > double* work, const int* lwork, int* info); > > Any ideas? > > --j > > > > On Fri, Apr 20, 2012 at 1:37 AM, Berend Hasselman <b...@xs4all.nl> wrote: > >> >> On 19-04-2012, at 20:50, Jonathan Greenberg wrote: >> >> > Folks: >> > >> > I'm trying to port some code from python over to R, and I'm running >> into a >> > wall finding R code that can solve a generalized eigenvalue problem >> > following this function model: >> > >> > >> http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eig.html >> > >> > Any ideas? I don't want to call python from within R for various >> reasons, >> > I'd prefer a "native" R solution if one exists. Thanks! >> >> An old thread is here: >> http://tolstoy.newcastle.edu.au/R/help/05/06/6802.html >> >> R does provide eigen(). >> R has the Lapack routines dggev and dgges in its library. >> You'd have to write your own .Fortran interface to those routines. >> >> Berend >> >> > > > -- > Jonathan A. Greenberg, PhD > Assistant Professor > Department of Geography and Geographic Information Science > University of Illinois at Urbana-Champaign > 607 South Mathews Avenue, MC 150 > Urbana, IL 61801 > Phone: 415-763-5476 > AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307, Skype: jgrn3007 > http://www.geog.illinois.edu/people/JonathanGreenberg.html > -- Jonathan A. Greenberg, PhD Assistant Professor Department of Geography and Geographic Information Science University of Illinois at Urbana-Champaign 607 South Mathews Avenue, MC 150 Urbana, IL 61801 Phone: 415-763-5476 AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307, Skype: jgrn3007 http://www.geog.illinois.edu/people/JonathanGreenberg.html [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.