On 26 October 2011 at 00:02, Slava Razbash wrote: | I will illustrate the idea of what I want to do with an example that | just uses an integer. So for example: | | int myNumber; | nyNumber = 5; | | So can I do something with Rcpp and SEXP objects as below. I know that | my code will be wrong but I am trying to convey an idea, so think of | it a pseudocode. | Pseudocode "example": | | SEXP myFunction(SEXP myVector_s ) { | Rcpp::NumericVector myVector; | Rcpp::NumericVector myVector::as(myVector_s); | | }
I don;t understand what that is trying "to convoy". | Further, will the following work with RcppArmadillo? | | SEXP myFunction(SEXP myVector_s ) { | arma::rowvec myVector; | myVector = Rcpp::as<arma::rowvec>(myVector_s); | | } The second line is correct. The first line (empty ctor) I am unsure about. Why don't you test it? Generally speaking, if the constructor you think you need is not there, and you really think you need it, then you will have to write a new constructor yourself. Alternatively, you can rethink your problem and/or try to figure out how others have done it. Trying stating more clearly what you want to do, why/how you want to do it and what you actually tried plus any applicable errors. Also don't abuse this list as a C++ tutorial site. There are better ones, and we have limited resources we like to focus on Rcpp. Thanks, Dirk -- "Outside of a dog, a book is a man's best friend. Inside of a dog, it is too dark to read." -- Groucho Marx _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel