Rev 42333 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/det.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\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.}}\details{The \code{determinant} functionuses an LU decomposition and the \code{det} function is simply awrapper around a call to \code{determinant}.Often, computing the determinant is \emph{not} what you should be doingto solve a given problem.}\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.}}\examples{(x <- matrix(1:4, ncol=2))unlist(determinant(x))det(x)det(print(cbind(1,1:3,c(2,0,1))))}\keyword{array}