Learn R Programming

msos (version 1.2.0)

reverse.kronecker: Reverses the matrices in a Kronecker product

Description

This function takes a matrix that is Kronecker product \(A \otimes B\) (Definition 3.5), where \(A\) is \(P x Q\) and \(B\) is \(N x M\), and outputs the matrix \(B \otimes A\).

Usage

reverse.kronecker(ab, p, qq)

Arguments

ab

The \((NP) \times (QM)\) matrix \(A \otimes B\).

p

The number of rows of \(A\).

qq

The number of columns of \(A\).

Value

The \((NP) \times (QM)\) matrix \(B \otimes A\).

See Also

kronecker

Examples

Run this code
# NOT RUN {
# Create matrices
(A <- diag(1, 3))
(B <- matrix(1:6, ncol = 2))

# Perform kronecker
(kron <- kronecker(A, B))

# Perform reverse kronecker product
(reverse.kronecker(kron, 3, 3))

# Perform kronecker again
(kron2 <- kronecker(B, A))
# }

Run the code above in your browser using DataLab