\HeaderA{triangularMatrix-class}{Virtual Class of Triangular Matrices in package:Matrix}{triangularMatrix.Rdash.class}
\aliasA{coerce,lgeMatrix,triangularMatrix-method}{triangularMatrix-class}{coerce,lgeMatrix,triangularMatrix.Rdash.method}
\aliasA{coerce,ngeMatrix,triangularMatrix-method}{triangularMatrix-class}{coerce,ngeMatrix,triangularMatrix.Rdash.method}
\aliasA{coerce,triangularMatrix,symmetricMatrix-method}{triangularMatrix-class}{coerce,triangularMatrix,symmetricMatrix.Rdash.method}
\keyword{classes}{triangularMatrix-class}
\begin{Description}\relax
The virtual class of triangular matrices,\code{"triangularMatrix"},
from the package \pkg{Matrix} contains numeric and logical, dense and
sparse matrices, e.g., see the examples.

The main use will be in methods (and C functions) that can deal with
all triangular matrices.
\end{Description}
\begin{Section}{Slots}
\describe{
\item[\code{uplo}:] String (of class \code{"character"}).  Must be
either "U", for upper triangular, and "L", for lower triangular.
\item[\code{diag}:] String (of class \code{"character"}).  Must be
either \code{"U"}, for unit triangular (diagonal is all ones), or
\code{"N"} for non-unit.  The diagonal elements are not
accessed internally when \code{diag} is \code{"U"}. For
\code{\LinkA{denseMatrix}{denseMatrix.Rdash.class}} classes, they need to be
allocated though, i.e., the length of the \code{x} slot does not
depend on \code{diag}.
\item[\code{Dim}, \code{Dimnames}:] The dimension (a length-2
\code{"integer"}) and corresponding names (or \code{NULL}),
inherited from the \code{\LinkA{Matrix}{Matrix.Rdash.class}}, see there.
}
\end{Section}
\begin{Section}{Extends}
Class \code{"Matrix"}, directly.
\end{Section}
\begin{Section}{Methods}
There's a C function \code{triangularMatrix\_validity()}
called by the internal validity checking functions.

Currently, \code{\LinkA{Schur}{Schur}}, \code{\LinkA{isSymmetric}{isSymmetric}} and
\code{as()} (i.e. \code{\LinkA{coerce}{coerce}}) have methods with
\code{triangularMatrix} in their signature.
\end{Section}
\begin{SeeAlso}\relax
Classes \code{\LinkA{symmetricMatrix}{symmetricMatrix.Rdash.class}}, and, e.g.,
\code{\LinkA{dtrMatrix}{dtrMatrix.Rdash.class}} for numeric \emph{dense} matrices, or
\code{\LinkA{ltCMatrix}{ltCMatrix.Rdash.class}} for a logical \emph{sparse} matrix
subclass of \code{"triangularMatrix"}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
showClass("triangularMatrix")

## The names of direct subclasses:
scl <- getClass("triangularMatrix")@subclasses
directly <- sapply(lapply(scl, slot, "by"), length) == 0
names(scl)[directly]
\end{ExampleCode}
\end{Examples}

