% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_eigen.R
\name{eigen}
\alias{eigen}
\alias{eigen.default}
\alias{eigen.HDF5Matrix}
\title{Spectral decomposition}
\usage{
eigen(x, symmetric, ...)

\method{eigen}{default}(
  x,
  symmetric = !isSymmetric(x),
  only.values = FALSE,
  EISPACK = FALSE,
  ...
)

\method{eigen}{HDF5Matrix}(x, symmetric = TRUE, ...)
}
\arguments{
\item{x}{An \code{HDF5Matrix} or any R object accepted
by \code{base::eigen()}.}

\item{symmetric}{Logical. Whether to assume \code{x} is symmetric.
Passed to \code{base::eigen()} for plain R objects.}

\item{\dots}{For \code{HDF5Matrix}: named arguments forwarded to
\code{x$eigen()} — \code{k} (integer, number of eigenvalues),
\code{which} (character, \code{"LM"}/\code{"SM"}/etc.),
\code{compute_vectors} (logical), \code{tolerance} (numeric),
\code{max_iter} (integer), \code{overwrite} (logical),
\code{threads} (integer). Ignored for \code{eigen.default}.}

\item{only.values}{Logical. Ignored; present for compatibility with
\code{base::eigen}.}

\item{EISPACK}{Logical. Ignored; present for compatibility with
\code{base::eigen}.}
}
\value{
For \code{HDF5Matrix}: a named list with elements
\code{values} (numeric vector), \code{vectors}
(\code{HDF5Matrix} or \code{NULL}), \code{values_imag}, and
\code{is_symmetric}.
For other objects: the result of \code{base::eigen()}.
}
\description{
Overrides \code{base::eigen()} to dispatch on \code{HDF5Matrix}
objects. For plain R matrices the call is forwarded to
\code{base::eigen()}.
}
\examples{
\donttest{
tmp <- tempfile(fileext = ".h5")
m   <- crossprod(matrix(rnorm(400), 20, 20))
X   <- hdf5_create_matrix(tmp, "data/M", data = m)
ev  <- eigen(X, symmetric = TRUE, k = 5L)
ev$values
close(ev$vectors)
close(X)
unlink(tmp)
}
}
\seealso{
\code{\link{svd.HDF5Matrix}}, \code{\link{prcomp.HDF5Matrix}}
}
