Re: [Rcpp-devel] Setting seed using Rcpp

2018-02-07 Thread Hao Ye
number generators in std: https://www.guyrutenberg.com/2014/05/03/c-mt19937-example/ Best, -- Hao Ye On Wed, Feb 7, 2018 at 10:20 AM, Hmamouche Youssef < hmamoucheyus...@gmail.com> wrote: > Hi, > > I get a note from R CMD check for an Rcpp package: > > Found ‘_srand’,

Re: [Rcpp-devel] best way of documenting Rcpp Modules

2017-08-15 Thread Hao Ye
thing ~ `exportPattern("^[[:alpha:]]+")` You may want to give that a try. If that doesn't work, it would help to see this issue as a minimal reproducible example, e.g. a link to a GitHub repo. Best, -- Hao Ye h...@ucsd.edu On Tue, Aug 15, 2017 at 4:12 PM, Luis Avila wrote: > I've u

Re: [Rcpp-devel] RFC: Rcpp modules vs. RefClass

2016-11-29 Thread Hao Ye
vignette -- I tried it anyway, and it crashed my R session. :) Best, -- Hao Ye h...@ucsd.edu On Tue, Nov 29, 2016 at 11:02 AM, Kevin Ushey wrote: > To be brief -- Rcpp modules are effectively in maintenance mode at this > point; we don't plan to extend / improve modules beyond resolving

Re: [Rcpp-devel] Method with default params using RCPP_MODULE

2016-10-26 Thread Hao Ye
7;s an R function to handle default arguments. Best, -- Hao Ye h...@ucsd.edu On Wed, Oct 26, 2016 at 8:53 AM, Dirk Eddelbuettel wrote: > > On 26 October 2016 at 09:48, Sergio Bra wrote: > | I am exposing a c++ class using Rcpp. It works fantastic, but my problem > is how > | to imple

Re: [Rcpp-devel] Rcpp C++11 on Windows

2016-01-27 Thread Hao Ye
Peter, You can refer to https://gcc.gnu.org/gcc-4.6/cxx0x_status.html to see what features are supported in gcc4.6. Best, -- Hao Ye h...@ucsd.edu > On Jan 27, 2016, at 3:32 PM, Peter Meissner wrote: > > Thank you all so much for your suggestions. > > What features I needed

Re: [Rcpp-devel] Is Rcpp:: not a good choice for iterators?

2015-08-11 Thread Hao Ye
It also looks like you are not initializing the size of Gamete in the "full Rcpp" version, so it is resizing on every loop iteration... Best, -- Hao Ye h...@ucsd.edu On Tue, Aug 11, 2015 at 12:06 PM, Tim Keitt wrote: > 1) Figure out where you are making full copies of your da

Re: [Rcpp-devel] Call by reference

2015-07-29 Thread Hao Ye
The data.table package might also be worth looking into. Best, -- Hao Ye h...@ucsd.edu > On Jul 29, 2015, at 10:37 AM, Dirk Eddelbuettel wrote: > > > On 29 July 2015 at 17:28, Rguy wrote: > | The reason I am interested in using call by reference is that I am accessing >

Re: [Rcpp-devel] rsession memory consumption blows up

2015-06-23 Thread Hao Ye
in the function itself. Best, -- Hao Ye h...@ucsd.edu > On Jun 23, 2015, at 9:57 AM, Dirk Eddelbuettel wrote: > > > On 23 June 2015 at 18:45, Fabio Tordini wrote: > | it seems like the C++ function, once it terminates its execution, does > | not free the memory used. instead

Re: [Rcpp-devel] Question about include paths

2015-06-12 Thread Hao Ye
Hi Tim, My Rcpp package compiles fine with header files in /inst/include (and subfolders), but I do have the following line in my Makevars: > PKG_CXXFLAGS = -pedantic -Wall -I../inst/include You may need the last option there to add /inst/include to the search path. Best, -- Hao Y

Re: [Rcpp-devel] Bizarre Rcpp::XPtr problem on GCC

2015-05-20 Thread Hao Ye
Kevin, I think Dirk is looking for a MWE (minimal working example). Best, -- Hao Ye h...@ucsd.edu > On May 20, 2015, at 5:35 PM, Kevin Thornton wrote: > > Dirk, > > What are you asking for? I provided a working source file + the Rscripts I > used to identify the proble

Re: [Rcpp-devel] CharacterVector::is_na

2015-02-10 Thread Hao Ye
_na(x[0]);}" and see the Rcpp gallery for more examples: http://gallery.rcpp.org/articles/working-with-missing-values/ Best, -- Hao Ye h...@ucsd.edu On Feb 10, 2015, at 1:50 PM, Tim Keitt wrote: > library(Rcpp) > def = "bool is_na_character_vector(CharacterVector x) { return

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-23 Thread Hao Ye
Simon, There are also some minima-finding functions in GSL that you may want to look into. The source for RcppGSL might help with a fully c++ version. Best, -- Hao Ye h...@ucsd.edu On Dec 23, 2014, at 12:04 AM, Simon Riddell wrote: > Hello, > > I have been judiciously using RCP

Re: [Rcpp-devel] Pass an Rcpp module object to a method belonging to another module from R?

2014-09-09 Thread Hao Ye
en there's probably a simpler, if less elegant, implementation to do what you want. Best, -- Hao Ye h...@ucsd.edu On Tue, Sep 9, 2014 at 6:47 PM, Grant Brown wrote: > Thanks for the feedback, I'll definitely consider those options. > > My original motivation (besides the sheer con

Re: [Rcpp-devel] Comparison of R and rcpp for backsolve

2014-06-27 Thread Hao Ye
s for backsolve() show: > This is a wrapper for the level-3 BLAS routine dtrsm. which *is* specific for triangular matrices. So I'm not surprised that backsolve() is faster than RcppArmadillo's solve() in your situation. Best, -- Hao Ye h...@ucsd.edu On Jun 27, 2014, at 4:14 PM, Peter Ross

Re: [Rcpp-devel] [OT] Asking for a quick OS X favour

2014-05-11 Thread Hao Ye
> > So why does the directory /usr/include/hiredis get omitted on OS X? I think this might be a general quirk on OS X. I recall having to manually set the "-I/usr/local/include" flag for any compilations that need local libraries. Best, -- Hao Ye h...@ucsd.edu On Sun, May

Re: [Rcpp-devel] [OT] Asking for a quick OS X favour

2014-05-11 Thread Hao Ye
ure: WARNING: Unsetting ac_cv_header_hiredis_hiredis_h OS X 10.9.2 compiler: Apple LLVM version 5.1 (clang-503.0.40) R: 3.0.2 Best, -- Hao Ye h...@ucsd.edu On May 11, 2014, at 8:11 AM, Dirk Eddelbuettel wrote: > > I'd appreciate if someone running OS X could run a quick test for me. I

Re: [Rcpp-devel] Fwd: Looping over the parameters of a function

2014-04-08 Thread Hao Ye
Hi Petre, It sounds like what you want is to curry a function f(x, a) into a function g(x) that will then get passed to your root-finder. See: http://stackoverflow.com/questions/152005/how-can-currying-be-done-in-c Best, -- Hao Ye h...@ucsd.edu On Apr 8, 2014, at 8:36 AM, Petre Caraiani wrote

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Hao Ye
> But your threads, > be it pthreads or C++11 threads are not calling the RNG supplied by R, are they? That is correct. Just reading and writing to c++ vectors (with some non-R deterministic computations in-between) Best, -- Hao Ye h...@ucsd.edu On Mar 11, 2014, at 1:15 PM, Dirk Eddelb

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Hao Ye
> Just accessing / setting data structures should work (but test first...), > RNGs is clearly asking for trouble. FWIW, I've been able to get this working using Rcpp and C++11 threads. (but using native C++ data structures, of course) Best, -- Hao Ye h...@ucsd.edu On Mar 11, 2014,

Re: [Rcpp-devel] How to speed up selection of unique unordered pairs

2013-12-30 Thread Hao Ye
On Dec 30, 2013, at 1:38 PM, Dirk Eddelbuettel wrote: > > Asis, > > On 30 December 2013 at 19:01, Asis Hallab wrote: > | I need to select all unique un-ordered pairs from a two column table. > | Here each row represents a pair and > | two rows, un-ordered pairs p and q are identical if > | eith

[Rcpp-devel] linking error when using matrices?

2013-11-25 Thread Hao Ye
I get when I try to run the RcppGibbs.R example or Rcpp-unitTests.R. C==filt says the I'm currently on OS X 10.9 with R 3.0.2 and Rcpp 0.10.6. Does anyone know how to fix this? Best, -- Hao Ye h...@ucsd.edu ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel