Displaying 1 result from an estimated 1 matches for "crossp3".
Did you mean:
crossp
2014 Sep 30
1
Package Rcpp: Question conerning source code of cpp files and related question
...Rcpp my question might sound silly, but
any help and comments are highly welcome.
Thank you very much for your help in advance!
Best,
Martin
crossp.cpp:
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
//[[Rcpp::export]]
NumericMatrix crossp3(NumericMatrix Xr) {
int n = Xr.nrow(), k = Xr.ncol();
arma::mat X(Xr.begin(), n, k, false);
arma::mat XXt = X.t()*X;
return Rcpp::wrap(XXt);
}
[[alternative HTML version deleted]]