# SCM Repository

[matrix] View of /pkg/man/Cholesky.Rd
 [matrix] / pkg / man / Cholesky.Rd

# View of /pkg/man/Cholesky.Rd

Tue Jan 15 10:16:29 2008 UTC (11 years, 7 months ago) by maechler
File size: 3534 byte(s)
solve(<CHMfactor>, <numeric>) and related
\name{Cholesky}
\docType{genericFunction}
\alias{Cholesky}
\alias{Cholesky,dsCMatrix-method}
\title{Cholesky Decomposition of a Sparse Matrix}
\usage{
Cholesky(A, perm = TRUE, LDL = TRUE, super = FALSE, \dots)
}
\description{
Computes the Cholesky decomposition of a sparse, symmetric,
should rather be used unless you are interested in the different kinds
of sparse Cholesky decompositions.
}
\arguments{
\item{A}{sparse symmetric matrix.  No missing values or IEEE special
values are allowed.}
\item{perm}{logical scalar indicating if a fill-reducing permutation
should be computed and applied to the rows and columns of \code{A}.
Default is \code{TRUE}.}
\item{LDL}{logical scalar indicating if the decomposition should be
computed as LDL' where \code{L} is a unit lower triangular matrix.
The alternative is LL' where \code{L} is lower triangular with
arbitrary diagonal elements.  Default is \code{TRUE}.}
\item{super}{logical scalar indicating is a supernodal decomposition
should be created.  The alternative is a simplicial decomposition.
Default is \code{FALSE}.}
\item{\dots}{further arguments passed to or from other methods.}
}
\value{
an object inheriting from either
argument; both classes extend \code{"\linkS4class{CHMfactor}"} which

In other words, the result of \code{Cholesky()} is \emph{not} a
matrix, and if you want one, you should probably rather use
}
\details{
This is a generic function with special methods for different types
of matrices.  Use \code{\link{showMethods}("Cholesky")} to list all
the methods for the \code{\link{Cholesky}} generic.

The method for class \code{\linkS4class{dsCMatrix}} of sparse matrices
--- the only one available currently ---
is based on functions from the CHOLMOD library.

Again: If you just want the Cholesky decomposition of a matrix, you
}
\references{
Tim Davis (2005)
\emph{{CHOLMOD}: sparse supernodal {Cholesky} factorization and
update/downdate}
\url{http://www.cise.ufl.edu/research/sparse/cholmod/}

Timothy A. Davis (2006)
\emph{Direct Methods for Sparse Linear Systems}, SIAM Series
\dQuote{Fundamentals of Algorithms}.
}
\seealso{
Note the extra \code{\link{solve}(*, system = . )} options in

Note that \code{\link{chol}()} returns matrices (inheriting from
\code{"\linkS4class{CHMfactor}"} object, and hence a typical user
will rather use \code{chol(A)}.
}
\examples{
data(KNex)
mtm <- with(KNex, crossprod(mm))
str(mtm@factors) # empty list()
Cholesky(mtm)             # uses show(<MatrixFactorization>)
str(mtm@factors) # 'sPDCholesky' (simpl)
(Cm <- Cholesky(mtm, super = TRUE))
str(mtm@factors) # 'sPDCholesky'  *and*  'SPDCholesky'
str(cmat <- as(Cm, "sparseMatrix"))
cmat[1:20, 1:20]
b <- matrix(c(rep(0, 711), 1), nc = 1)
## solve(Cm, b) by default solves  Ax = b, where A = Cm'Cm !
x <- solve(Cm, b)
stopifnot(identical(x, solve(Cm, b, system = "A")),
all.equal(x, solve(mtm, b)))
}
\keyword{array}
\keyword{algebra}