Rev 26532 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{det}\title{Calculate the Determinant of a Matrix}\alias{det}\alias{determinant}\alias{determinant.matrix}\usage{det(x, \dots)determinant(x, logarithm = TRUE, \dots)}\description{\code{det} calculates the determinant of a matrix. \code{determinant}is a generic function that returns separately the modulus of the determinant,optionally on the logarithm scale, and the sign of the determinant.}\arguments{\item{x}{numeric matrix.}\item{logarithm}{logical; if \code{TRUE} (default) return thelogarithm of the modulus of the determinant.}\item{\dots}{Optional arguments. At present none are used. Previousversions of \code{det} allowed an optional \code{method} argument.This argument will be ignored but will not produce an error.}}\value{For \code{det}, the determinant of \code{x}. For \code{determinant}, alist with components\item{modulus}{a numeric value. The modulus (absolute value) of thedeterminant if \code{logarithm} is \code{FALSE}; otherwise thelogarithm of the modulus.}\item{sign}{integer; either \eqn{+1} or \eqn{-1} according to whetherthe determinant is positive or negative.}}\note{Often, computing the determinant is \emph{not} what you should be doingto solve a given problem.Prior to version 1.8.0 the \code{det} function had a \code{method}argument to allow use of either a QR decomposition or aneigenvalue-eigenvector decomposition. The \code{determinant} function nowuses an LU decomposition and the \code{det} function is simply awrapper around a call to \code{determinant}.}%\seealso{\code{\link{eigen}}, \code{\link{qr}}, \code{\link{svd}}}\examples{(x <- matrix(1:4, ncol=2))unlist(determinant(x))det(x)det(print(cbind(1,1:3,c(2,0,1))))}\keyword{array}