Re: [Rcpp-devel] Strange behavior of NumericMatrix

2011-09-20 Thread Romain François
Hello, On a more cosmetic level, you could use the pow function from sugar: require( Rcpp ) require( inline ) fx<- cxxfunction( signature(), plugin="Rcpp", body=" Rcpp::NumericMatrix out_xx(10, 4); for(int i=0; i<4; i++) out_xx(_,i) = pow( seq(0, 9), i ) ;

Re: [Rcpp-devel] Strange behavior of NumericMatrix

2011-09-02 Thread Steve Lianoglou
Hi, On Sat, Sep 3, 2011 at 12:54 AM, Noah Silverman wrote: > Hi, > > Just starting to learn about Rcpp tonight (Using it through the inline > library) > > I'm attempting to construct a matrix and then fill it with values as I > iterate through my function.  The results are wrong.  Am I accessin

[Rcpp-devel] Strange behavior of NumericMatrix

2011-09-02 Thread Noah Silverman
Hi, Just starting to learn about Rcpp tonight (Using it through the inline library) I'm attempting to construct a matrix and then fill it with values as I iterate through my function. The results are wrong. Am I accessing the cells of the matrix incorrectly? The idea was to have an integer i