RcppEigen - going from inline to a .cpp function in a package and “Map”
Everything seems to work in my package, but I wanted to check if the steps to make it were correct and about memory use using "Map". (It's a simple example, somewhere in-between the inline examples and the fastLm() example.) Here is an inline function that takes the maximum over each column of a matrix: library(Rcpp); library(inline); library(RcppEigen); maxOverColCpp <- ' using Eigen::Map; using Eigen::MatrixXd; // Map the double matrix AA from R const Map<MatrixXd> A(as<Map<MatrixXd> >(AA)); // evaluate and columnwise maximum entry of A const MatrixXd Amax(A.colwise().maxCoeff()); return