[Rcpp-devel] Rcpp:integer class?

Cedric Ginestet c.ginestet05 at googlemail.com
Tue Dec 21 18:38:25 CET 2010


Thanks Dirk,

Actually, I've tried to look for that class in here:
http://dirk.eddelbuettel.com/code/rcpp/html/namespaceRcpp.html

but I didn't find it. Where can I get some info on that?
Cheers,
Ced

On 21/12/10 17:33, Dirk Eddelbuettel wrote:
> On 21 December 2010 at 17:23, Cedric Ginestet wrote:
> | Dear Rcpp experts,
> |
> | I am trying to find a way a single integer to a function. See the code below. I
> | am here obliged to translage v1 as an IntegerVector and then to select only its
> | first argument. Is there a better way of doing this, where I don't have to
> | declare an entire vector for such a task?
>
> Look at the Rcpp::Params class.
>
> Dirk
>
>
> | ###########################################
> | src2<- '
> |   IntegerVector x1(v1);
> |   IntegerMatrix xD(D);
> |   IntegerVector Drow(xD.ncol());
> |   for(int i=0; i<xD.ncol(); i++) Drow[i]=xD(x1[0],i);
> | return Drow;
> | '
> | rowExtraction<- cxxfunction(signature(D="matrix",v1="integer"),body=
> | src2,plugin="Rcpp",verbose=TRUE)
> | rowExtraction(D,1)
> | ############################################
> |
> | Thank you very much,
> | Cedric
> |
> |
> | --
> | Cedric Ginestet
> | Centre for Neuroimaging Sciences (L3.04)
> | NIHR Biomedical Research Centre
> | Department of Neuroimaging
> | Institute of Psychiatry, Box P089
> | King's College London
> | De Crespigny Park
> | London
> | SE5 8AF
> | Tel: (+44) 20-3228-3052
> | Fax: (+44) 20-3228-2116
> | Email: cedric.ginestet at kcl.ac.uk
> |
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>


More information about the Rcpp-devel mailing list