R/kmat.R

Defines functions kmat

Documented in kmat

kmat <-
function(m,n)
# commutation matrix or order m x n
{
 K <- matrix(0,m*n,m*n)
 for (i in 1 : m){
  for (j in 1 : n){
    K[i + m*(j - 1), j + n*(i - 1)] <- 1
  }
 }
return(K)
}

Try the dmm package in your browser

Any scripts or data that you put into this service are public.

dmm documentation built on Aug. 21, 2025, 5:57 p.m.