#include <mypack.h>

//[[Rcpp::depends(mypack)]]

using namespace Rcpp;

//[[Rcpp::export]]
NumericVector aperm2_cpp(NumericVector AA, IntegerVector adim, IntegerVector perm){
  NumericVector out( AA.length() );
  IntegerVector pp = permuteCellEntries_cpp(perm, adim);
  return(out);
}


/*** R

x <- HairEyeColor

pp <- c(2,3,1)
aperm(x, pp)
aperm2_cpp(x, dim(x), pp)

 */

