| commutation_matrix {ADtools} | R Documentation |
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)
r |
integer; row dimension. |
c |
integer; column dimension. |
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)))