Dear Rcpp List,
My goal is to write a generic C++ optimizing function (call it "optim"
in this email) based on the Newton-Raphson algorithm. I will be
passing into the optimizing function 4 arguments:
1. (pointer to) a function, "f1", to be optimized,
2. an initial value/vector,
3. the remaini
Hello all,
I need to convert a std::string to a RAWSXP. I think i know hot do to this
without Rcpp. It goes something like this (i haven't tested this):
SEXP stringToRaw(std::string x) {
SEXP y;
PROTECT(y = allocVector(RAWSXP, x.length()));
memcpy(RAW(y), x.data(), x.length());
UNPROTECT(1
Le 05/10/10 11:16, Christian Gunning a écrit :
Sorry for slow reply.
Or perhaps use the "_" thing :
ret( i, _ ) = ...
Is there documentation on _?
No.
It is used in a few places :
Function rnorm( "rnorm" ) ;
rnorm( 10, _["mean"] = 2.0 ) ;
Language call( "rnorm", _["sd"] = 3.0 ) ;
List: