Greetings. It appears that there is a limit of 20 items in a list created by;
Rcpp::List:create
I.e., the appended code works as expected if I omit all references to "x21",
but fails with an error (shown below, after the code example) when I include
"x21". (The successful output shown bel
On Tue, Nov 1, 2011 at 3:32 PM, Michael Hannon wrote:
>
>
> Greetings. It appears that there is a limit of 20 items in a list created by;
>
> Rcpp::List:create
>
> I.e., the appended code works as expected if I omit all references to "x21",
> but fails with an error (shown below, after the co
Hi,
I recommend the following workaround instead...
std::vector _your_favorite_list;
_your_favourite_list.push_back(_whatever_);
_your_favourite_list.push_back(_whatever_);
_your_favourite_list.push_back(_whatever_);
_your_favourite_list.push_back(_whatever_);
_your_favourite_list.push_back(_wha
I have installed the int64 package using the sources from the SVN
repository and now I get
$ R-patched CMD INSTALL -c --byte-compile ~/sloc/Rcpp
* installing to library ‘/home/bates/R/x86_64-unknown-linux-gnu-library/2.14’
* installing *source* package ‘Rcpp’ ...
** libs
ccache g++ -I/home/bates/
Cool, glad to have gotten down to the bottom of this.
Davor
On October 30, 2011 08:48:10 PM Slava Razbash wrote:
> Drik, Davor,
>
> I don't think that what I was observing was a memory leak.
>
> I have ran the functions provided by Dirk. I have also used gc() as
> suggested by Davor. The memor
Hi, guys. I have some pretty large arrays in R and i wanted to do some time
consuming modifications of these arrays in C++ without actually copying
them, just by passing pointers to them. Since i don't know internal data
structures of R, i am not sure it's possible, but i thought it was. Here is
so
On 1 November 2011 at 20:59, andre zege wrote:
| Hi, guys. I have some pretty large arrays in R and i wanted to do some time
| consuming modifications of these arrays in C++ without actually copying them,
| just by passing pointers to them. Since i don't know internal data structures
| of R, i am
Dirk, apologies, i meant to sent it to R-devel, i just replied to wrong
list. Now that i read responses on both lists, i am confused. Simon Urbanek
seemed to indicate that call by reference from
R to C++ is impossible with .C interface and dangerous and unreliable with
.Call. If i understood you co
Andre,
You should compare your code with a working RcppArmadillo example,
such as the one on Dirk's website:
http://dirk.eddelbuettel.com/code/rcpp.armadillo.html
"Writing R Extensions" descirbes the .Call() interface and the R API.
When using .Call(), it does not make copies of the objects passed
Slava, thanks for your pointers. I changed the code to the way Dirk example
goes, namely
--
#include
RcppExport void modify(SEXP mem){
Rcpp::NumericMatrix r_m(mem);
arma::mat m(r_m.begin(), r_m.nrow(), r_m.ncol(), false);
m.print();
m=m+
On Tue, Nov 1, 2011 at 9:11 PM,
wrote:
>
>> .Call("modify", m)
>> m
> [,1] [,2] [,3] [,4] [,5]
> [1,] 1 3 5 7 9
> [2,] 2 4 6 8 10
>
>
> It didn't segfault, but the memory in R process didn't change as you see,
> although the matrix in armadillo code doubled. Which
Christian,
1. in my previous post i used exactly that same constructor you are
talking about as you can see from the code i posted
2. i am not doing any math in this illustrative example, i am just
modifying a toy matrix and showing that this modification didn't propagate
back to R. Which means
12 matches
Mail list logo