reverse.kronecker: Reverses the matrices in a Kronecker product

View source: R/reverse.kronecker.R

reverse.kroneckerR Documentation

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


# 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))

coatless/msos documentation built on Nov. 16, 2023, 5:31 a.m.