powered by
Suppose A is a (r x c) matrix, then a (rc x rc) matrix K is a commutation matrix if K
commutation_matrix(r, c)
integer; row dimension.
integer; column dimension.
# 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