vectorize the RcppSimpleTensor