\HeaderA{kronecker-methods}{Methods for Function 'kronecker()' in Package 'Matrix'}{kronecker.Rdash.methods}
\aliasA{kronecker,ANY,diagonalMatrix-method}{kronecker-methods}{kronecker,ANY,diagonalMatrix.Rdash.method}
\aliasA{kronecker,ANY,Matrix-method}{kronecker-methods}{kronecker,ANY,Matrix.Rdash.method}
\aliasA{kronecker,ANY,sparseMatrix-method}{kronecker-methods}{kronecker,ANY,sparseMatrix.Rdash.method}
\aliasA{kronecker,dgTMatrix,dgTMatrix-method}{kronecker-methods}{kronecker,dgTMatrix,dgTMatrix.Rdash.method}
\aliasA{kronecker,dgTMatrix,dtTMatrix-method}{kronecker-methods}{kronecker,dgTMatrix,dtTMatrix.Rdash.method}
\aliasA{kronecker,diagonalMatrix,ANY-method}{kronecker-methods}{kronecker,diagonalMatrix,ANY.Rdash.method}
\aliasA{kronecker,dsparseMatrix,dsparseMatrix-method}{kronecker-methods}{kronecker,dsparseMatrix,dsparseMatrix.Rdash.method}
\aliasA{kronecker,dtTMatrix,dgTMatrix-method}{kronecker-methods}{kronecker,dtTMatrix,dgTMatrix.Rdash.method}
\aliasA{kronecker,dtTMatrix,dtTMatrix-method}{kronecker-methods}{kronecker,dtTMatrix,dtTMatrix.Rdash.method}
\aliasA{kronecker,Matrix,ANY-method}{kronecker-methods}{kronecker,Matrix,ANY.Rdash.method}
\aliasA{kronecker,sparseMatrix,ANY-method}{kronecker-methods}{kronecker,sparseMatrix,ANY.Rdash.method}
\aliasA{kronecker,sparseMatrix,TsparseMatrix-method}{kronecker-methods}{kronecker,sparseMatrix,TsparseMatrix.Rdash.method}
\aliasA{kronecker,TsparseMatrix,sparseMatrix-method}{kronecker-methods}{kronecker,TsparseMatrix,sparseMatrix.Rdash.method}
\aliasA{kronecker,TsparseMatrix,TsparseMatrix-method}{kronecker-methods}{kronecker,TsparseMatrix,TsparseMatrix.Rdash.method}
\keyword{methods}{kronecker-methods}
\keyword{array}{kronecker-methods}
\begin{Description}\relax
Computes Kronecker products for objects inheriting from
\code{"\LinkA{Matrix}{Matrix.Rdash.class}"}.

In order to preserver sparseness, we treat \code{0 * NA} as \code{0},
not as \code{\LinkA{NA}{NA}} as usually in \R{} (and as used for the
\pkg{base} function \code{\LinkA{kronecker}{kronecker}}).
\end{Description}
\begin{Section}{Methods}
\describe{

\item[kronecker] \code{signature(X = "Matrix", Y = "ANY")} .......
\item[kronecker] \code{signature(X = "ANY", Y = "Matrix")} .......
\item[kronecker] \code{signature(X = "diagonalMatrix", Y = "ANY")} .......
\item[kronecker] \code{signature(X = "sparseMatrix", Y = "ANY")} .......
\item[kronecker] \code{signature(X = "TsparseMatrix", Y = "TsparseMatrix")} .......
\item[kronecker] \code{signature(X = "dgTMatrix", Y = "dgTMatrix")} .......
\item[kronecker] \code{signature(X = "dtTMatrix", Y = "dtTMatrix")} .......

}
\end{Section}
\begin{Examples}
\begin{ExampleCode}
(t1 <- spMatrix(5,4, x= c(3,2,-7,11), i= 1:4, j=4:1)) #  5 x  4
(t2 <- kronecker(Diagonal(3, 2:4), t1))               # 15 x 12

## should also work with special-cased logical matrices
l3 <- upper.tri(matrix(,3,3))
M <- Matrix(l3)
(N <- as(M, "nsparseMatrix"))
N2 <- as(N, "generalMatrix")
MM <- kronecker(M,M)
NN <- kronecker(N,N)
NN2 <- kronecker(N2,N2)
stopifnot(identical(NN,MM),
          is(NN, "triangularMatrix"))
\end{ExampleCode}
\end{Examples}

