Re: [Rcpp-devel] how to reference a row of a matrix in C++ in Rcpp

2018-03-20 Thread Serguei Sokol
Le 20/03/2018 à 17:22, Dirk Eddelbuettel a écrit : Akshay, On 20 March 2018 at 15:54, akshay kulkarni wrote: | Can I also write this: | | M[1:i, n:m] as we write in R? Please consider to stop posting elementary C++ beginners question to the list. We do not provide as a C++ tutorial or trainin

Re: [Rcpp-devel] how to reference a row of a matrix in C++ in Rcpp

2018-03-20 Thread Dirk Eddelbuettel
Akshay, On 20 March 2018 at 15:54, akshay kulkarni wrote: | Can I also write this: | | M[1:i, n:m] as we write in R? Please consider to stop posting elementary C++ beginners question to the list. We do not provide as a C++ tutorial or training service here. Please learn at least /some/ C++ af

Re: [Rcpp-devel] how to reference a row of a matrix in C++ in Rcpp

2018-03-20 Thread akshay kulkarni
dear serguei, Thanks... Can I also write this: M[1:i, n:m] as we write in R? If not, are there any packages that do it for me? what about RcppEigen? Basically, I want to write the following R code: {p <- 1; for(i in 550:nrow(x)){ y[p] <-

Re: [Rcpp-devel] how to reference a row of a matrix in C++ in Rcpp

2018-03-20 Thread Serguei Sokol
Le 20/03/2018 à 12:10, akshay kulkarni a écrit : dear members,                              I came to know from stackoverflow that the following references a row in a matrix in C++: M[2] references 2nd row of the Matrix. SO is too big to check this assertion by ourself. Do you have a link?

[Rcpp-devel] Extract names of functions in module

2018-03-20 Thread Hola Kwame Adrakey
Dear all, Can anyone give me advice/help on how to list the name(s) of all functions defined within a module? Here is an example of what I am trying to achieve: Assuming that I have inc <- ' using namespace Rcpp; double SE(double alpha, double beta, double epsilon){ return alpha; }; double EI

Re: [Rcpp-devel] operator<< issues

2018-03-20 Thread Dirk Eddelbuettel
On 20 March 2018 at 11:42, Iñaki Úcar wrote: | I may have my own reasons for that, but that's not the point here. The | point is that I expected a homogeneous behaviour across Rcpp classes | when any object is passed to operator<< (i.e., print *something*). | | By grepping the source, I discovere

[Rcpp-devel] how to reference a row of a matrix in C++ in Rcpp

2018-03-20 Thread akshay kulkarni
dear members, I came to know from stackoverflow that the following references a row in a matrix in C++: M[2] references 2nd row of the Matrix. I am using Rcpp to write C++ code in R. However, I ended up with the following inconsistency: > M x y z [1,] 1 1 1

Re: [Rcpp-devel] operator<< issues

2018-03-20 Thread Iñaki Úcar
2018-03-20 4:33 GMT+01:00 Tim Keitt : > Why not something like: > > Rcpp::sourceCpp(code=' > #include >using Rcpp::Rcout; > >// [[Rcpp::export]] >void print_addr(SEXP x){ > Rcout << static_cast(x) << std::endl; > }') > > I'm not sure why one would expect Rcpp types t