Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-19 Thread Romain Francois
This now works with Row and Col too, as in : test.armadillo.sugar.ctor <- function(){ fx <- cxxfunction( signature(x= "numeric") , ' NumericVector xx(x) ; arma::mat m = xx + xx ; arma::colvec co = xx ; arma::rowvec ro = xx ; return List::create(

Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-18 Thread Romain Francois
After some discussion this morning with Conrad (who develops Armadillo), we've come up with a way that is not too intrusive on armadillo itself (it adds about 6 lines of code), yet opens a door for RcppArmadillo to adds its own constructors to the Mat template class. I've added this one now :

Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-17 Thread Romain Francois
Le 18/08/10 06:56, Davor Cubranic a écrit : On August 17, 2010 03:26:15 am Romain Francois wrote: 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 a

Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-17 Thread Davor Cubranic
On August 17, 2010 03:26:15 am Romain Francois wrote: > 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 vecto

Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-17 Thread Romain Francois
Le 17/08/10 13:36, Dirk Eddelbuettel a écrit : 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, wi

Re: [Rcpp-devel] RcppArmadillo and sugar

2010-08-17 Thread Dirk Eddelbuettel
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

[Rcpp-devel] RcppArmadillo and sugar

2010-08-17 Thread Romain Francois
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) ;