[Rcpp-devel] RcppArmadillo and sugar
Dirk Eddelbuettel
edd at debian.org
Tue Aug 17 13:36:36 CEST 2010
On 17 August 2010 at 12:26, Romain Francois wrote:
| Hello,
|
| After the last thread, I looked again at armadillo and came up with a
| way to make it aware of Rcpp sugar, so that we can create an armadillo
| matrix from an Rcpp sugar expression, without having to assign the
| expression into an Rcpp vector.
|
| For example :
|
| NumericVector xx(x) ;
| arma::mat m = forward( xx + xx ) ;
|
| But also for complex expressions : (expressions that make complex
| vectors ) :
|
| ComplexVector xx(x) ;
| arma::cx_mat m = forward( exp( xx ) ) ;
Very nice!
| It needs the svn version of both Rcpp and RcppArmadillo to work.
| It does not deal with dimensions at the moment, it just makes a arma
| matrix with one column, I'll deal with that later.
|
|
| The name forward might not be the right verb here, I was also thinking
| about "melt" so that we melt sugar into caramel, but I'd like to hear
| what others do with sugar.
How about "salt" ?
It's shorter too and not as unhealthy and yucky as caramel.
Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list