Re: [Rcpp-devel] clang does not like lists with a DataFrame inside?

2017-12-05 Thread Ramon Diaz-Uriarte
On Tue, 28-November-2017, at 00:24:33, Dirk Eddelbuettel wrote: > On 28 November 2017 at 00:03, Ramon Diaz-Uriarte wrote: > | Hi Dirk, > | > | > | On Mon, 27-November-2017, at 14:14:09, Dirk Eddelbuettel > wrote: > | > Ramon, > | > > | > On 27 Novemb

Re: [Rcpp-devel] clang does not like lists with a DataFrame inside?

2017-11-27 Thread Ramon Diaz-Uriarte
Hi Dirk, On Mon, 27-November-2017, at 14:14:09, Dirk Eddelbuettel wrote: > Ramon, > > On 27 November 2017 at 10:43, Ramon Diaz-Uriarte wrote: > | Dear All, > | > | I am trying to pass to C++ an R list that contains a data frame. Using gcc

[Rcpp-devel] clang does not like lists with a DataFrame inside?

2017-11-27 Thread Ramon Diaz-Uriarte
list, works fine with both gcc and clang #include using namespace Rcpp; // [[Rcpp::export]] void withList(Rcpp::List bl) { Rcpp::List df1 = bl["the_df"]; Rcpp::Rcout << " size is " << df1.size() << std::endl; Rcpp::IntegerVector c1 = df1["first&qu

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Ramon Diaz-Uriarte
On Wed, 24-06-2015, at 15:22, Matt D. wrote: > On 6/24/2015 15:07, Ramon Diaz-Uriarte wrote: >> Hi Matt, >> >> Thanks a lot for the details and the work. That is great! There is a >> problem, though: in my particular case, I am uploading my package to >> BioCon

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Ramon Diaz-Uriarte
in Windows. Best, R. On Wed, 24-06-2015, at 14:55, Matt D. wrote: > On 6/22/2015 12:31, Ramon Diaz-Uriarte wrote: >> Actually, I just noticed that things will not work if you need your package >> to run on Windoze: Rtools uses gcc 4.6.3 there, and this will not work with >>

Re: [Rcpp-devel] bool from list: unexpected result and differences between compilers/OSs

2015-06-23 Thread Ramon Diaz-Uriarte
Hi Dirk, On Mon, 22-06-2015, at 13:21, Dirk Eddelbuettel wrote: > On 22 June 2015 at 10:25, Ramon Diaz-Uriarte wrote: > | > | Dear All, > | > | Accessing an element of a list that should be TRUE/FALSE does not recognize > | the boolean properly in Windows/gcc-4.6.3 unless I

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-22 Thread Ramon Diaz-Uriarte
. Best, R. On Sat, 20-06-2015, at 23:38, Matt D. wrote: > On 6/20/2015 21:13, Ramon Diaz-Uriarte wrote: >> As a follow up to the thread below, using randutils has turned out to be >> very simple (and provides some additional nice features, such as pick, >> etc). Dire

[Rcpp-devel] bool from list: unexpected result and differences between compilers/OSs

2015-06-22 Thread Ramon Diaz-Uriarte
ol"]] readList(lFalse) == lFalse[["theBool"]] ## WRONG! should be 0 readList2(lTrue) == lTrue[["theBool"]] readList2(lFalse) == lFalse[["theBool"]] ## OK now: should be 0 */ -- Ramon Diaz-Uriarte Department of B

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-20 Thread Ramon Diaz-Uriarte
itself). That can be solved by changing the line auto exit_func = hash(&_Exit); by, say auto getenv_func = hash(&getenv); and making the corresponding change a little bit further below. Best, R. On Fri, 19-06-2015, at 00:13, Matt D. wrote: > On 6/18/2015 14:34, Ramon Diaz-Ur

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-19 Thread Ramon Diaz-Uriarte
Dear Matt, On Fri, 19-06-2015, at 00:13, Matt D. wrote: > On 6/18/2015 14:34, Ramon Diaz-Uriarte wrote: >> Dear All, >> >> Sometimes I use both R's and C++11's RNGs and distributions in the same >> code base (I am not using OpenMP or similar). Although this

[Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-18 Thread Ramon Diaz-Uriarte
td::endl; return f0(vec, ran_gen); } /*** R f4 <- function(seed = NULL) { if(is.null(seed)) seed <- as.integer(round(runif(1, min = 0, max = 2^16))) return(f3(seed)) } */ //// -- Ramon Diaz-Uriarte Department of

[Rcpp-devel] routine registration

2014-06-25 Thread Ramon Diaz-Uriarte
ackages in CRAN and BioConductor that import Rcpp and almost none, of those I've looked at, use registration (except for a few that use Kmisc's registerFunctions). Thanks, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madr

Re: [Rcpp-devel] Largest size of a NumericMatrix, segfaults and error messages

2013-04-02 Thread Ramon Diaz-Uriarte
On Mon, 1 Apr 2013 10:13:54 -0500,Dirk Eddelbuettel wrote: > On 1 April 2013 at 17:04, Ramon Diaz-Uriarte wrote: > | > | > | > | On Mon, 1 Apr 2013 08:15:48 -0500,Dirk Eddelbuettel wrote: > | > | > On 1 April 2013 at 14:48, Ramon Diaz-Uriarte wrote: &

Re: [Rcpp-devel] Largest size of a NumericMatrix, segfaults and error messages

2013-04-01 Thread Ramon Diaz-Uriarte
On Mon, 1 Apr 2013 08:15:48 -0500,Dirk Eddelbuettel wrote: > On 1 April 2013 at 14:48, Ramon Diaz-Uriarte wrote: > | > | Dear All, > | > | I am confused about creating Rcpp Numeric Matrices larger than > | .Machine$integer.max. The code below illustrates some of the po

[Rcpp-devel] Largest size of a NumericMatrix, segfaults and error messages

2013-04-01 Thread Ramon Diaz-Uriarte
tmp <- f1(4294967, 501) ## negative length vectors 50 * 9000 > .Machine$integer.max tmp <- f1(50, 9000) ## sometimes segfaults tmp[500000, 9000] object.size(tmp) ## things are missing prod(dim(tmp)) > .Machine$integer.max ## using either of these usually leads to segfault

[Rcpp-devel] Rf_ReplIteration and profiling output from google perftools

2013-03-18 Thread Ramon Diaz-Uriarte
mples, etc, but I didn't want to fill up the list with unnecessary stuff, especially since I think my confusion is due to my not understanding something about Rf_ReplIteration). Best, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Aut

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Ramon Diaz-Uriarte
Rcpp.h is wrong. You should only > include RcppArmadillo.h. Oooops. Will not do that again. Best, R. > I should do something so that the compiler tells you this. > Romain > Le 10/12/12 16:49, Ramon Diaz-Uriarte a écrit : > > > > > > Dear All, > > > > I am tr

[Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Ramon Diaz-Uriarte
lt;< std::endl; double outf2 = f2(X, c1); std::cout << "f0, this is X after f2" << std::endl << X << std::endl; // double outf3 = f3(X.unsafe_col(c1)); //will not work //double outf3 = f3(X.col(c1)); //will not work return List::create(Na

Re: [Rcpp-devel] RcppArmadillo: resize vs. insert_cols

2012-12-10 Thread Ramon Diaz-Uriarte
most of the time is spent inside matrix > multiplication, or solve(), or svd(), etc, refactoring would make little > overall difference. > On Monday, December 10, 2012, Ramon Diaz-Uriarte wrote: > > > > Dear All, > > > > I am using RcppArmadillo, and I am creating

[Rcpp-devel] RcppArmadillo: resize vs. insert_cols

2012-12-10 Thread Ramon Diaz-Uriarte
esign manual, 2nd ed", p. 67), but I think I've read that for std::vector, a) (with push_back), is a better choice than b) (using reserve, not resize). For me, a) involves writing less code. Thanks, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medici

[Rcpp-devel] "const" not allowed for Matrix arguments?

2012-11-16 Thread Ramon Diaz-Uriarte
// [[Rcpp::export]] int f2(const Rcpp::IntegerMatrix m1) { const Rcpp::IntegerMatrix::Column c1 = m1(_, 1); int dd = c1[0] * 2; return dd; } // [[Rcpp::export]] int f3(const Rcpp::IntegerMatrix m1) { int dd = m1(0, 0) * 2; return dd; } -- Ramon Diaz-Uriarte Department of Biochemistry

[Rcpp-devel] changing a "const" argument

2012-11-16 Thread Ramon Diaz-Uriarte
his expected? Thanks, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdia...@gmail.com ramon.d...@iib.uam.es http://ligarto.org/rd

Re: [Rcpp-devel] Rcpp 0.10

2012-11-15 Thread Ramon Diaz-Uriarte
and hope to have that ready for the next release. Thanks for the clarification. Yes, it was the mixing of generated and user files that was most troubling to me. But then, I realize, however, that for most cases I can think of I would not need to mix things, given how simple the compileAtt

[Rcpp-devel] Rcpp 0.10

2012-11-15 Thread Ramon Diaz-Uriarte
Any hints that can be provided here? Thanks again for the package and the new additions to it. Best, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-24

Re: [Rcpp-devel] Matrix: column-major storage?

2012-11-08 Thread Ramon Diaz-Uriarte
j + 1) > > > > would be contiguous in memory (whereas x(i + 1, j) could be extremely far > > away, depending on the size of the matrix). > > > > However, it seems that with Matrix objects it is the other way around, so > > that x(i, j) is next to x(i + 1, j), not

Re: [Rcpp-devel] Matrix: column-major storage?

2012-11-07 Thread Ramon Diaz-Uriarte
lay around with RcppArmadillo and RcppEigen, and also see if I can easily adapt my algorithms to use column-major order efficiently. Thanks again. Best, R. On Wed, 7 Nov 2012 13:43:52 -0600,Dirk Eddelbuettel wrote: > Hi Ramon, > And welcome! > On 7 November 2012 at 20:25, Ramon

[Rcpp-devel] Matrix: column-major storage?

2012-11-07 Thread Ramon Diaz-Uriarte
m = as(dm); IntegerMatrix xm(m, m); int i; int j; for(j = 0; j < m; j++) { for(i = 0; i < m; i++) { xm(i, j) = i * m + j; } } ', plugin = "Rcpp", verbose = TRUE) nn <- 1 benchmark(byRow(nn), byCol(nn), column