\HeaderA{dtCMatrix-class}{Triangular, (compressed) sparse column matrices}{dtCMatrix.Rdash.class}
\aliasA{Arith,dtCMatrix,dtCMatrix-method}{dtCMatrix-class}{Arith,dtCMatrix,dtCMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dgCMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dgCMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dgeMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dgeMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dgTMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dgTMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dsCMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dsCMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dtrMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dtrMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,dtTMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,dtTMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,ltCMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,ltCMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,ntCMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,ntCMatrix.Rdash.method}
\aliasA{coerce,dtCMatrix,TsparseMatrix-method}{dtCMatrix-class}{coerce,dtCMatrix,TsparseMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,dgeMatrix-method}{dtCMatrix-class}{coerce,dtTMatrix,dgeMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,dgTMatrix-method}{dtCMatrix-class}{coerce,dtTMatrix,dgTMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,dtCMatrix-method}{dtCMatrix-class}{coerce,dtTMatrix,dtCMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,dtrMatrix-method}{dtCMatrix-class}{coerce,dtTMatrix,dtrMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,generalMatrix-method}{dtCMatrix-class}{coerce,dtTMatrix,generalMatrix.Rdash.method}
\aliasA{coerce,dtTMatrix,matrix-method}{dtCMatrix-class}{coerce,dtTMatrix,matrix.Rdash.method}
\aliasA{coerce,matrix,dtCMatrix-method}{dtCMatrix-class}{coerce,matrix,dtCMatrix.Rdash.method}
\aliasA{coerce,matrix,dtTMatrix-method}{dtCMatrix-class}{coerce,matrix,dtTMatrix.Rdash.method}
\aliasA{dtTMatrix-class}{dtCMatrix-class}{dtTMatrix.Rdash.class}
\aliasA{solve,dtCMatrix,CsparseMatrix-method}{dtCMatrix-class}{solve,dtCMatrix,CsparseMatrix.Rdash.method}
\aliasA{solve,dtCMatrix,dgeMatrix-method}{dtCMatrix-class}{solve,dtCMatrix,dgeMatrix.Rdash.method}
\aliasA{solve,dtCMatrix,matrix-method}{dtCMatrix-class}{solve,dtCMatrix,matrix.Rdash.method}
\aliasA{solve,dtCMatrix,missing-method}{dtCMatrix-class}{solve,dtCMatrix,missing.Rdash.method}
\aliasA{solve,dtCMatrix,numeric-method}{dtCMatrix-class}{solve,dtCMatrix,numeric.Rdash.method}
\aliasA{t,dtCMatrix-method}{dtCMatrix-class}{t,dtCMatrix.Rdash.method}
\aliasA{t,dtTMatrix-method}{dtCMatrix-class}{t,dtTMatrix.Rdash.method}
\keyword{classes}{dtCMatrix-class}
\keyword{algebra}{dtCMatrix-class}
\begin{Description}\relax
The \code{"dtCMatrix"} class is a class of triangular, sparse
matrices in the compressed, column-oriented format.  In this
implementation the non-zero elements in the columns are sorted into
increasing row order.  The \code{"dtTMatrix"} class is a class of
triangular, sparse matrices in triplet format.
\end{Description}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{new("dtCMatrix",
    ...)} or calls of the form  \code{new("dtTMatrix", ...)}, but more
typically automatically via \code{\LinkA{Matrix}{Matrix}()} or coercion such as
\code{as(x, "dtCMatrix")}.
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{uplo}:] Object of class \code{"character"}. Must be
either "U", for upper triangular, and "L", for lower triangular.
\item[\code{diag}:] Object of class \code{"character"}. Must be
either \code{"U"}, for unit triangular (diagonal is all ones), or
\code{"N"}; see \code{\LinkA{triangularMatrix}{triangularMatrix.Rdash.class}}.
\item[\code{p}:] Object of class \code{"integer"} of pointers, one
for each column, to the initial (zero-based) index of elements in
the column. (Only present in the \code{dtCMatrix} class.)
\item[\code{i}:] Object of class \code{"integer"} of length nnzero
(number of non-zero elements).  These are the row numbers for
each non-zero element in the matrix.
\item[\code{j}:] Object of class \code{"integer"} of length nnzero
(number of non-zero elements).  These are the column numbers for
each non-zero element in the matrix. (Only present in the
\code{dtTMatrix} class.)
\item[\code{x}:] Object of class \code{"numeric"} - the non-zero
elements of the matrix.
\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{"dgCMatrix"}, directly.
Class \code{"triangularMatrix"}, directly.
Class \code{"dMatrix"}, \code{"sparseMatrix"}, and more by class
\code{"dgCMatrix"} etc, see the examples.
\end{Section}
\begin{Section}{Methods}
\describe{
\item[coerce] \code{signature(from = "dtCMatrix", to = "dgTMatrix")}
\item[coerce] \code{signature(from = "dtCMatrix", to = "dgeMatrix")}
\item[coerce] \code{signature(from = "dtTMatrix", to = "dgeMatrix")}
\item[coerce] \code{signature(from = "dtTMatrix", to = "dtrMatrix")}
\item[coerce] \code{signature(from = "dtTMatrix", to = "matrix")}
\item[solve] \code{signature(a = "dtCMatrix", b = "matrix")}
\item[solve] \code{signature(a = "dtCMatrix", b = "dgeMatrix")}
\item[solve] \code{signature(a = "dtCMatrix", b = "missing")}
\item[solve] \code{signature(a = "dtCMatrix", b = "numeric")}
\item[solve] \code{signature(a = "dtCMatrix", b = "CsparseMatrix")}:
fully sparse triangular solve, in traditional S/\R\ aka
\code{\LinkA{backsolve}{backsolve}}.
\item[t] \code{signature(x = "dtCMatrix")}: returns the transpose of
\code{x}
\item[t] \code{signature(x = "dtTMatrix")}: returns the transpose of
\code{x}
}
\end{Section}
\begin{SeeAlso}\relax
Classes \code{\LinkA{dgCMatrix}{dgCMatrix.Rdash.class}}, \code{\LinkA{dgTMatrix}{dgTMatrix.Rdash.class}},
\code{\LinkA{dgeMatrix}{dgeMatrix.Rdash.class}}, and \code{\LinkA{dtrMatrix}{dtrMatrix.Rdash.class}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
showClass("dtCMatrix")

showClass("dtTMatrix")
t1 <- new("dtTMatrix", x= c(3,7), i= 0:1, j=3:2, Dim= as.integer(c(4,4)))
t1
## from  0-diagonal to unit-diagonal {low-level step}:
tu <- t1 ; tu@diag <- "U"
tu
(cu <- as(tu, "dtCMatrix"))
str(cu)# only two entries in @i and @x
stopifnot(cu@i == 1:0,
          all(2 * symmpart(cu) == Diagonal(4) + forceSymmetric(cu)))

t1[1,2:3] <- -1:-2
diag(t1) <- 10*c(1:2,3:2)
t1 # still triangular
(it1 <- solve(t1))
t1. <- solve(it1)
all(abs(t1 - t1.) < 10 * .Machine$double.eps)
\end{ExampleCode}
\end{Examples}

