I\'m trying to port a very fast R function for calculating cosine similarity into Rcpp with Armadillo and sparse matrix operations.
Here\'s the R function:
<