\HeaderA{LU-class}{LU (dense) Matrix Decompositions}{LU.Rdash.class}
\aliasA{denseLU-class}{LU-class}{denseLU.Rdash.class}
\aliasA{expand,denseLU-method}{LU-class}{expand,denseLU.Rdash.method}
\aliasA{solve,denseLU,missing-method}{LU-class}{solve,denseLU,missing.Rdash.method}
\keyword{classes}{LU-class}
\keyword{algebra}{LU-class}
\begin{Description}\relax
The \code{"LU"} class is the \emph{virtual} class of LU decompositions of
real matrices.  \code{"denseLU"} the class of LU decompositions of
dense real matrices.
\end{Description}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{new("denseLU", ...)}.
More commonly the objects are created explicitly from calls of the form
\code{\LinkA{lu}{lu}(mm)} where \code{mm} is an object that inherits from the
\code{"dgeMatrix"} class or as a side-effect of other functions applied
to \code{"dgeMatrix"} objects.
\end{Section}
\begin{Section}{Extends}
\code{"LU"} directly extends the virtual class
\code{"\LinkA{MatrixFactorization}{MatrixFactorization.Rdash.class}"}.

\code{"denseLU"} directly extends \code{"LU"}.
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{x}:] object of class \code{"numeric"}.  The \code{"L"}
(unit lower triangular) and \code{"U"} (upper triangular) factors
of the original matrix.  These are stored in a packed format
described in the Lapack manual.
\item[\code{perm}:] Object of class \code{"integer"} - a vector of
length \code{min(Dim)} that describes the permutation applied to
the rows of the original matrix.  The contents of this vector are
described in the Lapack manual.
\item[\code{Dim}:] the dimension of the original matrix; inherited
from class \code{\LinkA{MatrixFactorization}{MatrixFactorization.Rdash.class}} .
}
\end{Section}
\begin{Section}{Methods}
\describe{
\item[expand] \code{signature(x = "denseLU")}: Produce the \code{"L"} and
\code{"U"} (and \code{"P"}) factors as a named list of matrices,
see also the example below.
\item[solve] \code{signature(a = "denseLU", b = "missing")}: ComputeProduce the \code{"L"} and
\code{"U"} (and \code{"P"}) factors as a named list of matrices,
see also the example below.
}
\end{Section}
\begin{SeeAlso}\relax
class \code{\LinkA{sparseLU}{sparseLU.Rdash.class}} for LU decompositions of
\emph{sparse} matrices;
further, class \code{\LinkA{dgeMatrix}{dgeMatrix.Rdash.class}} and functions \code{\LinkA{lu}{lu}},
\code{\LinkA{expand}{expand}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
set.seed(1)
mm <- Matrix(round(rnorm(9),2), nrow = 3)
mm
str(lum <- lu(mm))
elu <- expand(lum)
elu # three components: "L", "U", and "P", the permutation
elu$L %*% elu$U
(m2 <- with(elu, P %*% L %*% U)) # the same as 'mm'
stopifnot(all.equal(as(mm, "matrix"),
                    as(m2, "matrix")))
\end{ExampleCode}
\end{Examples}

