\Header{det}{Calculate the Determinant of a Matrix}
\keyword{array}{det}
\begin{Description}\relax
\code{det} calculates the determinant of a matrix either by QR
decomposition or from the eigenvalues, see \code{\Link{qr}} and
\code{\Link{eigen}}.\end{Description}
\begin{Usage}
\begin{verbatim}
det(x, method = c("qr", "eigenvalues"), tol = 1e-07)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] numeric matrix.
\item[\code{method}] \code{"qr"} (default) or \code{"eigenvalues"}.
\item[\code{tol}] tolerance, used only for method \code{"qr"}.
\end{ldescription}
\end{Arguments}
\begin{Value}
The determinant, or zero if \code{qr} determines the matrix to be
numerically singular.\end{Value}
\begin{Note}\relax
Often, computing the determinant is \emph{not} what you should be doing
to solve a given problem.

The \code{"qr"} method is much faster for large matrices.\end{Note}
\begin{SeeAlso}\relax
\code{\Link{eigen}}, \code{\Link{qr}}, \code{\Link{svd}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(x <- matrix(1:4, ncol=2))
det(x)
det(x, method="eigenvalues")

det(print(cbind(1,1:3,c(2,0,1))))
\end{ExampleCode}
\end{Examples}

