Learn R Programming

ADtools (version 0.5.4)

commutation_matrix: Commutation matrix

Description

Suppose A is a (r x c) matrix, then a (rc x rc) matrix K is a commutation matrix if K

Usage

commutation_matrix(r, c)

Arguments

r

integer; row dimension.

c

integer; column dimension.

Examples

Run this code
# NOT RUN {
A <- randn(3, 4)
K <- commutation_matrix(3, 4)
compare <- function(x, y) {
    cbind(x, y, err = abs(x - y))
}
compare(K %*% vec(A), vec(t(A)))

# }

Run the code above in your browser using DataLab