On Thu, Feb 26, 2015 at 12:28 PM, Matt D. wrote:
> On 2/26/2015 18:59, Dirk Eddelbuettel wrote:
>>
>> On 26 February 2015 at 18:35, Matt D. wrote:
>> | Which incidentally brings me to the advice I usually give in these
>> situations:
>> | unless you're absolutely dependent on the "features" of
>>
On 2/26/2015 18:59, Dirk Eddelbuettel wrote:
On 26 February 2015 at 18:35, Matt D. wrote:
| Which incidentally brings me to the advice I usually give in these situations:
| unless you're absolutely dependent on the "features" of `Rcpp::NumericVector`
| just forget about it and replace all uses wi
On 26 February 2015 at 18:35, Matt D. wrote:
| Which incidentally brings me to the advice I usually give in these situations:
| unless you're absolutely dependent on the "features" of `Rcpp::NumericVector`
| just forget about it and replace all uses with the standard container
| `std::vector`.
No
On 2/26/2015 16:37, Pierre GLOAGUEN wrote:
Thanks, it works!
I'm not familiar with C++, is it necessary to always use such a
function in C++ or is it because of R/C++ interface?
Hi Pierre!
You're witnessing yet another fascinating difference between (usual in
the world of C++) value semantics
Ok, i'll do this.
Thanks and have a nice day,
Pierre
Le 26/02/2015 16:51, Dirk Eddelbuettel a écrit :
On 26 February 2015 at 16:37, Pierre GLOAGUEN wrote:
| Thanks, it works!
| I'm not familiar with C++, is it necessary to always use such a function in
C++
| or is it because of R/C++ interface
On 26 February 2015 at 16:37, Pierre GLOAGUEN wrote:
| Thanks, it works!
| I'm not familiar with C++, is it necessary to always use such a function in
C++
| or is it because of R/C++ interface?
Please use a Google search (or equivalent) for Rcpp::clone. This has been
discussed extensively on nu
Thanks, it works!
I'm not familiar with C++, is it necessary to always use such a function
in C++ or is it because of R/C++ interface?
Thanks again for your help,
Pierre
Le 26/02/2015 16:30, Jeffrey Pollock a écrit :
Perhaps use the clone() function?
library(Rcpp)
cppFunction("
NumericVecto
Perhaps use the clone() function?
library(Rcpp)
cppFunction("
NumericVector par_CMAtR(NumericVector vec_CMA) {
NumericVector out = clone(vec_CMA);
out[5] = exp(out[5]);
return out;
}
")
vec_C <- rep(1, 6)
par_CMAtR(vec_C)
print(vec_C)
On Thu, Feb 26, 2015 at 3:16 PM, Pierre GLOAGUEN
Hello everybody,
I have a very simple example
I have a vector vec_CMA which length is a multiple of 6.
I want to get the exact same vector, except the last element which is
the exponential of the last element of vec_CMA
The code is the following
//myfun.cpp
#include
using namespace Rcpp;
//