The R Project SVN R

Rev

Rev 26986 | Rev 37126 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26986 Rev 28048
Line 1... Line 1...
1
\name{eigen}
1
\name{eigen}
2
\alias{eigen}
2
\alias{eigen}
3
\alias{La.eigen}
-
 
4
\title{Spectral Decomposition of a Matrix}
3
\title{Spectral Decomposition of a Matrix}
5
\usage{
4
\usage{
6
eigen(x, symmetric, only.values = FALSE, EISPACK = FALSE)
5
eigen(x, symmetric, only.values = FALSE, EISPACK = FALSE)
7
La.eigen(x, symmetric, only.values = FALSE,
-
 
8
         method = c("dsyevr", "dsyev"))
-
 
9
}
6
}
10
\arguments{
7
\arguments{
11
  \item{x}{a matrix whose spectral decomposition is to be computed.}
8
  \item{x}{a matrix whose spectral decomposition is to be computed.}
12
  \item{symmetric}{if \code{TRUE}, the matrix is assumed to be symmetric
9
  \item{symmetric}{if \code{TRUE}, the matrix is assumed to be symmetric
13
    (or Hermitian if complex) and only its lower triangle is used.
10
    (or Hermitian if complex) and only its lower triangle is used.
Line 16... Line 13...
16
  \item{only.values}{if \code{TRUE}, only the eigenvalues are computed
13
  \item{only.values}{if \code{TRUE}, only the eigenvalues are computed
17
    and returned, otherwise both eigenvalues and eigenvectors are
14
    and returned, otherwise both eigenvalues and eigenvectors are
18
    returned.}
15
    returned.}
19
  \item{EISPACK}{logical. Should EISPACK be used (for compatibility with
16
  \item{EISPACK}{logical. Should EISPACK be used (for compatibility with
20
    \R < 1.7.0)?}
17
    \R < 1.7.0)?}
21
  \item{method}{The LAPACK routine to use in the real symmetric case.}
-
 
22
}
18
}
23
\description{
19
\description{
24
  Computes eigenvalues and eigenvectors.
20
  Computes eigenvalues and eigenvectors.
25
}
21
}
26
\details{
22
\details{
27
  These functions use the LAPACK routines DSYEV/DSYEVR,
23
  By default \code{eigen} uses the LAPACK routines DSYEVR/DSYEV,
28
  DGEEV, ZHEEV and ZGEEV, and \code{eigen(EISPACK=TRUE)} provides an
24
  DGEEV, ZHEEV and ZGEEV whereas \code{eigen(EISPACK=TRUE)} provides an
29
  interface to the EISPACK routines \code{RS}, \code{RG}, \code{CH}
25
  interface to the EISPACK routines \code{RS}, \code{RG}, \code{CH}
30
  and \code{CG}.
26
  and \code{CG}.
31
   
27
   
32
  If \code{symmetric} is unspecified, the code attempts to
28
  If \code{symmetric} is unspecified, the code attempts to
33
  determine if the matrix is symmetric up to plausible numerical
29
  determine if the matrix is symmetric up to plausible numerical
34
  inaccuracies.  It is faster and surer to set the value yourself.
30
  inaccuracies.  It is faster and surer to set the value yourself.
35
 
31
 
36
  \code{eigen} is preferred to \code{eigen(EISPACK=TRUE)}
32
  \code{eigen} is preferred to \code{eigen(EISPACK = TRUE)}
37
  for new projects, but its eigenvectors may differ in sign and
33
  for new projects, but its eigenvectors may differ in sign and
38
  (in the asymmetric case) in normalization. (They may also differ
34
  (in the asymmetric case) in normalization. (They may also differ
39
  between methods and between platforms.)
35
  between methods and between platforms.)
40
 
36
 
41
  The LAPACK routine DSYEVR is usually substantially
37
  In the real symmetric case, LAPACK routine DSYEVR is used which
42
  faster than DSYEV: see
-
 
43
  \url{http://www.cs.berkeley.edu/~demmel/DOE2000/Report0100.html}.
-
 
44
  Most benefits are seen with an optimized BLAS system.
-
 
45
 
-
 
46
  Using \code{method="dsyevr"} requires IEEE 754 arithmetic.  Should
38
  requires IEEE 754 arithmetic.  Should this not be supported on
47
  this not be supported on your platform, \code{method="dsyev"} is
-
 
48
  used, with a warning.
39
  your platform, DSYEV is used, with a warning.
49
 
40
 
50
  Computing the eigenvectors is the slow part for large matrices.
41
  Computing the eigenvectors is the slow part for large matrices.
51
}
42
}
52
\value{
43
\value{
53
  The spectral decomposition of \code{x} is returned as components of a
44
  The spectral decomposition of \code{x} is returned as components of a