Faster dendrogram manipulation using Rcpp