R/permutations.R

Defines functions permutations

permutations = function(n){

  x = numeric(n*factorial(n))
  
 
  obj = .C("AllPerms", size1 = as.integer(n), perms1 = as.integer(x))
 
  
  x = matrix(obj$perms1+1, factorial(n),n, byrow = TRUE)
  
  return(x)

}



  

Try the cmbClust package in your browser

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

cmbClust documentation built on Nov. 3, 2022, 5:05 p.m.