Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Kaveh Vakili
,){ const int n = Rcpp_x.nrow(); const int p = Rcpp_x.ncol(); NumericMatrix Rcpp_x(R_x); Map x(Rcpp_x.begin(),n,p); MatrixXf x_cen = x.cast(); Best, >On Sat, Mar 10, 2012 at 6:05 PM, Kaveh Vakili wrote: >> Hi Steve, >> >> Timing: >> >&g

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Kaveh Vakili
>to me, but I've never measured... > >Best, >-Jared > >On Sat, Mar 10, 2012 at 8:09 PM, Dirk Eddelbuettel wrote: >> >> On 11 March 2012 at 01:33, Kaveh Vakili wrote: >> | >> | >Don't take this the wrong way, but we are not here to debug or re

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Kaveh Vakili
rge is it, typically? I'm was not even so enclined to post my code --my question is more general. Best, > >On 11 March 2012 at 01:05, Kaveh Vakili wrote: >| Hi Steve, >| >| Timing: >| >| i use: >| >| int start_s=clock(); >| .. >| .. >| int

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Kaveh Vakili
n,0,n-1); VectorXf urd = VectorXf::Random(p).array().abs(); for(i=0;iA; for(int i=1;iHi Kaveh, > >On Sat, Mar 10, 2012 at 5:58 PM, Kaveh Vakili wrote: >> Hi all, >> >> the same code when timed in cpp (i.e. without any interfacing with R) >&g

[Rcpp-devel] rcpp overhead

2012-03-10 Thread Kaveh Vakili
Hi all, the same code when timed in cpp (i.e. without any interfacing with R) runs about 2 times faster than when called from R and timed from R's system.time(). In this type of overhead normal or is it a sign i'm doing something not optimally? Best, __

[Rcpp-devel] matrix of float in rcpp

2012-03-10 Thread Kaveh Vakili
Hi all, i have a compiling cpp code that i want to use in R. NumericMatrix Rcpp_x(R_x); Map x(Rcpp_x.begin(),n,p); is there a way, with rcpp, to map R_x to a MatrixXf object? Best, ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-projec

Re: [Rcpp-devel] Matrix assignment with inline

2010-11-04 Thread Kaveh Vakili
Thanks for the advice Dirk, > >Kaveh, > >If you are having problems with things like matrix indexing I would recommend >a somewhat more incremental approach: > > pass a matrix from R, find the maximum element and return it > > pass a matrix from R, find the min and maximum elements and

[Rcpp-devel] Matrix assignment with inline

2010-11-04 Thread Kaveh Vakili
Hi list, I'm trying to learn inline by translating snippets of c++ code from the book "Numerical Recipes". in page 44-45, there is a c++ code to perform Gauss-Jordan elimination of a matrix (see below). I understand that they have a large template of additional operator/function/class (it is o

Re: [Rcpp-devel] problem with devel code (solved)

2010-10-31 Thread Kaveh Vakili
require( Rcpp ) require( inline ) f.Rcpp <- cxxfunction( signature( x = "matrix" ), ' NumericMatrix input( x ) ; NumericMatrix output = clone( input ) ; int nr = input.nrow(), nc = input.ncol() ; NumericVector tmp( nr ); for( int i=0; i >On 31 October 2010 at

Re: [Rcpp-devel] __ambiguous_overload_for_ ‘operator[]’

2010-10-31 Thread Kaveh Vakili
with >iterators (with v as the target, not pdB). Telling v's constructor the size to >pre-allocate would be good, too. > >Davor > > >On 2010-10-27, at 3:22 PM, Kaveh Vakili wrote: > >> trying to feed the beast something line by line (if this works to the end it >

[Rcpp-devel] problem with devel code

2010-10-31 Thread Kaveh Vakili
Hi, i tried to inline the code for f.Rcpp found here: http://article.gmane.org/gmane.comp.lang.r.rcpp/851/match=matrix+inline I get a mysterious bug. I'l not sure what's wrong with the code, can anyone comment ? ___ Rcpp-devel mailing list Rcpp-devel@

[Rcpp-devel] ambiguous overload for ‘operator[ ]’

2010-10-27 Thread Kaveh Vakili
trying to feed the beast something line by line (if this works to the end it may become an instance of quickselect() :) int k = Rcpp::as(kr); NumericVector pdA(pdAr); int n = pdA.size(); //this: //double *pdB = new double [n] ; //becomes

Re: [Rcpp-devel] Inline (ghost from the devel still walks?)

2010-10-27 Thread Kaveh Vakili
else equal. In other words, inline seems more convenient/flexible than using Rinside. Does this convenience comes with large costs ? The HPC slides/FAQ do not seem to address this (maybe the difference is irrelevant). >On 27 October 2010 at 22:24, Kaveh Vakili wrote: >| In trying to

[Rcpp-devel] Inline (ghost from the devel still walks?)

2010-10-27 Thread Kaveh Vakili
In trying to educated my self, i'm browsing through the abysses of the codes with inline taggs in the ML. http://article.gmane.org/gmane.comp.lang.r.rcpp/611 I tried to run fx5 (exactly as is shown there) but also any of the codes from the tread (fx2,...,) gives the same error message: Error

Re: [Rcpp-devel] Searching the archives ?

2010-10-27 Thread Kaveh Vakili
thank you very much. > >On 27 October 2010 at 21:25, Kaveh Vakili wrote: >| Are the archives of this devel somehow searchable ? >| If yes how ? > >Google, rseek.org, etc may work well enough. However, you are not limited by >the web view offered of R-Forge -- the list a

[Rcpp-devel] Searching the archives ?

2010-10-27 Thread Kaveh Vakili
Are the archives of this devel somehow searchable ? If yes how ? Also, my questions essentially relate to 'inline', Am i at the right place ? If not can you advise ? thanks, ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://list