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 beca
ction("
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
mailto:pierre.gloag...@ifremer.fr>> wrote:
)
[1] 1 1 1 1 1 2.718282
8
works fine. Except the vec_C is modified too!
vec_C
[1] 1 1 1 1 1 2.718282
It's the first time I have this kind of problem. What is wrong in my code?
Thanks for your help,
Pierre Gloaguen
___
Rcpp-devel mailing list
ws), even if, so far, I'm learning
how to use it.
Just one last thing, congratulations for your package, the improvement
in computation time is amazing (not far than 1000 times faster in my
case)!
Thanks again,
Pierre Gloaguen
Jonathan Olmsted a écrit :
So, you think I should go to
Hello Jonathan,
Thanks a lot for your help.
I didn't know valgrind, but i'll definitely go into it. Thanks very
much for your help.
So, you think I should go to postfix increments instead of prefix?
I'm a beginner in C++, so I'm not comfortable on which of them to chose.
You seem to be righ
Hello Dirk,
I will do what I can to reduce the code and have to same error occuring.
Of course i don't expect you to read all of it :) I was just wondering
if that kind of memory problem occured before, and if has some
"typical/generic" solutions.
I will try to have a shortest code to exhibi
before in R, it was slower but it never failed for memory
reasons.
I run on R 3.1.1, platform x86_64-w64-mingw32/x64 (64-bit)
I work on windows 7.
I attach the cpp_functions, the R_programm that embeds the last
function, and a R file debug_test wich gives R code to test the
functions and lead
your code in any detail.
No worries! I'm glad I found out by myself after all this times
Have a nice day,
Pierre
Dirk
| like this
| NumericVector myfunction(NumericVector x){
| for(int= i = 0; i < x.size; ++i){
| //do my stuff;
| gc();
| }
| }
|
| Thanks for any help!
|
| Pierre
eads me to another question. Is there anyway to force the
garbage collection inside a Rcpp function?
like this
NumericVector myfunction(NumericVector x){
for(int= i = 0; i < x.size; ++i){
//do my stuff;
gc();
}
}
Thanks for any help!
Pierre Gloaguen
pgloa...@ifremer.fr a écrit :
Hello ev
rs for all
intermediate functions.
Sorry for the length of the function, I'm pretty sure the problem
comes from the main function, but it sadly depends on others (which,
as far as I know, don't pose problems)
Thanks in advance for any help,
Pierre Gloaguen
library(R
10 matches
Mail list logo