Re: [Rcpp-devel] R Memory Management and RInside

2012-03-06 Thread Whit Armstrong
looks like you did something bad with a pointer, but it's hard to know without seeing your code. why don't you run w/ valgrind, it might help you locate the problem. like this: warmstrong@krypton:~$ R --debugger=valgrind ==28550== Memcheck, a memory error detector ==28550== Copyright (C) 2002-201

[Rcpp-devel] Rcpp version of DATAPTR

2012-04-11 Thread Whit Armstrong
I've been looking in the archives of this list for a while, so forgive me if I've missed it. Does Rcpp expose a version of the DATAPTR macro? Sadly, I have a need for a void* in my code... So I need a very old school C way of accessing the raw memory referenced by an SEXP. I tried to use RAW(),

Re: [Rcpp-devel] Rcpp version of DATAPTR

2012-04-11 Thread Whit Armstrong
1, 2012 at 2:42 PM, Dirk Eddelbuettel wrote: > > On 11 April 2012 at 14:16, Whit Armstrong wrote: > | I've been looking in the archives of this list for a while, so forgive > | me if I've missed it. > | > | Does Rcpp expose a version of the DATAPTR macro? > > Nothi

Re: [Rcpp-devel] Rcpp version of DATAPTR

2012-04-11 Thread Whit Armstrong
kick in, then I should be all set... and yes. Looks good. Compiles. No test failures. Thanks again. -Whit On Wed, Apr 11, 2012 at 3:54 PM, Dirk Eddelbuettel wrote: > > On 11 April 2012 at 15:32, Whit Armstrong wrote: > | Thanks, Dirk. > | > | one more quick q. > | >

[Rcpp-devel] RcppArmadillo with R-devel

2012-04-26 Thread Whit Armstrong
Has anyone seen this subtle change between R 2.15 and R-devel for packages linking to RcppArmadillo? on R 2.15: warmstrong@krypton:~/dvl/R.packages/rcppbugs.Rcheck/rcppbugs/libs$ nm -C rcppbugs.so |grep assert warmstrong@krypton:~/dvl/R.packages/rcppbugs.Rcheck/rcppbugs/libs$ on R-devel: nodeadmi

Re: [Rcpp-devel] RcppArmadillo with R-devel

2012-04-26 Thread Whit Armstrong
> Well I did tell you (off-list) about the change which I had sprinkled into > your rcppbugs code in order to suppress such a warning with R 2.15.0 on your > initial release 0.0.2: Ugg. Sorry, it's been a blur the last couple of days. I'll revisit your suggestion. -Whit

Re: [Rcpp-devel] RcppArmadillo with R-devel

2012-04-26 Thread Whit Armstrong
Ok. got it working now. Thanks for preemptively pointing this out; sorry for overlooking your comments. -Whit On Thu, Apr 26, 2012 at 12:50 PM, Whit Armstrong wrote: >> Well I did tell you (off-list) about the change which I had sprinkled into >> your rcppbugs code in order to sup

[Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmc vs rcppbugs

2012-04-26 Thread Whit Armstrong
Slightly off topic, but Dirk kindly allowed me to make a quick benchmark post on rcppbugs. Just a short post to the list showing some performance numbers (for running a simple linear regression) of rcppbugs (with an RcppArmadillo core) vs MCMCpack (Scythe core) vs JAGS (?? core). I was fairly opt

Re: [Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmcvs rcppbugs

2012-04-27 Thread Whit Armstrong
e.wu-wien.ac.at > [mailto:rcpp-devel-boun...@r-forge.wu-wien.ac.at] On Behalf Of Dirk > Eddelbuettel > Sent: Thursday, April 26, 2012 11:28 PM > To: Whit Armstrong > Cc: rcpp-devel > Subject: Re: [Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmcvs > rcppbugs > &

Re: [Rcpp-devel] RcppArmadillo -- crude benchmark of various mcmcvs rcppbugs

2012-04-30 Thread Whit Armstrong
.40GHz > > Thanks, > Dale Smith, Ph.D. > Senior Financial Quantitative Analyst > Risk & Compliance > Fiserv. > 107 Technology Park > Norcross, GA 30092 > Office: 678-375-5315 > Mobile: 678-982-6599 > Mail: dale.sm...@fiserv.com > www.fiserv.com > > &

[Rcpp-devel] Eigen vs Arma -- was: Re: Ceres nonlinear least squares solver

2012-05-03 Thread Whit Armstrong
Doug, Apologies for my question, it's a little off topic from your original post (hence the modified subject). I've integrated Armadillo into the new mcmc packages I've been developing without giving much thought to Eigen. Unfortunately, the benchmarks page on the Armadillo site doesn't provide

Re: [Rcpp-devel] Eigen vs Arma -- was: Re: Ceres nonlinear least squares solver

2012-05-03 Thread Whit Armstrong
12 at 08:20, Whit Armstrong wrote: > | Doug, > | > | Apologies for my question, it's a little off topic from your original > | post (hence the modified subject). > | > | I've integrated Armadillo into the new mcmc packages I've been > | developing without givi

Re: [Rcpp-devel] Specifying compiler to use within Rcpp

2012-05-24 Thread Whit Armstrong
For mac specific questions, you should also try here: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Also, you might want to stick w/ gcc 4.6. gcc 4.7 is still very new, and I have already seen issues w/ cppbugs when -O2 is turned on... just my 2c. -Whit On Thu, May 24, 2012 at 7:34 PM, Nick

Re: [Rcpp-devel] Successful install of rcppbugs on Mac OS X 10.7

2012-05-25 Thread Whit Armstrong
Congrats! You might find these links useful. Here is my presentation from R/Fin: https://github.com/downloads/armstrtw/rcppbugs/rcppbugs.pdf Also, here is another github project where I'm collecting rcppbugs examples: https://github.com/armstrtw/rcppbugs.examples And please post any bugs you fi

Re: [Rcpp-devel] [ANN] Rcpp Gallery

2013-01-18 Thread Whit Armstrong
This is great, guys. In particular this example: http://gallery.rcpp.org/articles/creating-xts-from-c++/ I'm going to steal this and use it in my fts package. -Whit On Mon, Jan 14, 2013 at 11:14 AM, JJ Allaire wrote: > Hello everyone, > > We are excited to introduce a new website featuring Rc

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Whit Armstrong
you can also use intel TBB, just depends on your preference for syntax I suppose. I've never tried to use openMP threads, but intel tbb works quite nicely. example here based off of rrcov package: https://github.com/armstrtw/rrcov/blob/master/src/covOPW.cpp#L58 Sorry, Dirk, this doesn't use Rcpp

[Rcpp-devel] rcppredis

2014-06-20 Thread Whit Armstrong
I didn't see a separate mailing list for rcppredis, so posting here... Does anyone know how to set a value with a space in it from rcppredis? I can do it from the command line: warmstrong@krypton:~/dvl/c++/redis.example$ redis-cli SADD hats 'my big hat' (integer) 1 warmstrong@krypton:~/dvl/c++/re

Re: [Rcpp-devel] RcppBugs - Weibull, Lognormal

2014-08-11 Thread Whit Armstrong
Hi, Tony, and thanks Dirk and JL. The answer is that before alias templates ( http://en.cppreference.com/w/cpp/language/type_alias) each distribution needed its own class definition and header file. There was basically a large amount of overhead in maintaining each distribution. When the package

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Whit Armstrong
> indexing, but apparently one cannot pass more than one parameter to [] > so ... I guess I'll have to sacrifice look and feel for a minute. yes, same issue for me in tslib. but (i,j) is not so bad esp for matlab users. tslib users have it even harder since x() is used as lag/lead. x[] is used a

Re: [Rcpp-devel] matrix indexing

2010-01-23 Thread Whit Armstrong
I think the Armadillo stuff is great. MTL4 is also great, but lacking some of the features of Armadillo. http://www.osl.iu.edu/research/mtl/mtl4/ All the good libraries that I've seen allow you to construct objects from a pointer to raw memory and dimensions which should be very easy to write fo

Re: [Rcpp-devel] matrix indexing

2010-01-24 Thread Whit Armstrong
Oh, boy. I _do_ want a pony! > Don;t forget we all want a pony too.  Now, seriously, what is R++? > If I knew what you were talking about I might have a chance of answering this > :) I was talking about this one: http://www.cs.kent.ac.uk/projects/cxxr which Romain has pointed out in the next po

Re: [Rcpp-devel] Is declaring an argument as a reference the same as declaring it a pointer?

2010-03-27 Thread Whit Armstrong
All the newer c++ matrix template libraries are very good. I like Armadillo in particular with MTL as a close second. As much of a pain as it is to learn a new library, you code will be infinitely more readable if you use a matrix library. here are the operator examples from MTL4 and Armadillo f

Re: [Rcpp-devel] Rcpp 0.8.3 and those other operating systems

2010-07-06 Thread Whit Armstrong
Dominick, wtf? Rcpp is on one of the most rapid development cycles that I've ever seen. If you want stability, then why don't you wait about six more months before you start using Rcpp in your projects. Alternatively, you can easily center your package on a particular version by enclosing your p

[Rcpp-devel] inline with classes

2010-10-05 Thread Whit Armstrong
I just reviewed the Rcpp documentation. I see plenty of cfunction/cxxfunction examples, but I'm curious whether one can provide a class definition inline in an R script and then initialize an instance of the class and call a method on the class. all inline in R. Is this feature something you all

Re: [Rcpp-devel] inline with classes

2010-10-05 Thread Whit Armstrong
S can finally die. -Whit 2010/10/5 Dirk Eddelbuettel : > > Hi Whit, > > On 5 October 2010 at 12:25, Whit Armstrong wrote: > | I just reviewed the Rcpp documentation. > > Great. Now tell us how to make it sticky so that we get you to contribute :) > > | I see plenty of cfu

Re: [Rcpp-devel] inline with classes

2010-10-05 Thread Whit Armstrong
Thanks for the example! that makes everything clear. -Whit 2010/10/5 Dirk Eddelbuettel : > > On 5 October 2010 at 13:21, Whit Armstrong wrote: > | aha, thanks for correcting me. on the inline/Rcpp division of labor. > | > | So, what you are suggesting should have been obvious t

Re: [Rcpp-devel] inline with classes

2010-10-08 Thread Whit Armstrong
;- matrix(rnorm(NR*NC),NR,NC) y <- rnorm(NR) print(system.time(ans <- fun(x,y))) print(ans) actual run: > source("test.inline.bugs.R") user system elapsed 0.420 0.020 0.435 $b [1] -0.01127731 -0.11217234 $ar [1] 0.29405 2010/10/5 Dirk Eddelbuettel : > > On 5 Octob

Re: [Rcpp-devel] inline with classes

2010-11-04 Thread Whit Armstrong
Very cool that you guys used my example in your Google Tech Talk. Thanks for the continued hard work on Rcpp! -Whit 2010/10/9 Dirk Eddelbuettel : > > On 8 October 2010 at 23:26, Whit Armstrong wrote: > | Thanks again, Dirk. > | > | full example (sorry for the verbose post):

Re: [Rcpp-devel] Caching temporary results in long chains.

2010-12-09 Thread Whit Armstrong
unless you are preallocating space to store your answer, then every reassignment could potentially cause the whole vector to be reallocated. if you know in advance how many runs you will do, and the thinning, then preallocate the vector and assign into it. Alternatively, implement your mcmc model

Re: [Rcpp-devel] Loading a package using Rcpp Modules results in memory corruption

2011-01-10 Thread Whit Armstrong
Dominick, > Merging Rcpp into cxxPack may be the only way that I can move on to > the work that really interests me. I am open to other suggestions from > the R community... I strongly encourage you to do this. I think the nice folks at R-forge will even give you your own mailing list. Joking a

Re: [Rcpp-devel] Favourite Rcpp examples?

2011-04-26 Thread Whit Armstrong
I could probably show you the Gelman - Radon example in my MCMC framework. Might be able to do a speed comparison w/ JAGS, but not sure if there is sufficient time left for me to send and you to integrate the example. Let me know what you think. -Whit On Tue, Apr 26, 2011 at 6:56 PM, Dirk Edde

Re: [Rcpp-devel] Favourite Rcpp examples?

2011-04-27 Thread Whit Armstrong
On Wed, Apr 27, 2011 at 12:47 AM, Dirk Eddelbuettel wrote: > > On 26 April 2011 at 20:53, Whit Armstrong wrote: > | I could probably show you the Gelman - Radon example in my MCMC framework. > | > | Might be able to do a speed comparison w/ JAGS, but not sure if there > |

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Whit Armstrong
You're not the only person working on MCMC w/ Rcpp. I'm not sure about your exact question, but if you provide a .bug file or write your model in pseudo code (i.e. alpha ~ dnorm(0, tau)), then I'll write up a cppbugs example for you. -Whit On Wed, Jun 15, 2011 at 5:03 PM, Nicolas Heslot wrote

Re: [Rcpp-devel] variable affectation in Rcpp Rcpp Armadillo

2011-06-15 Thread Whit Armstrong
I'm not giving up yet. I'll implement the distribution that is missing, and send you the example if you lay out your model w/ pseudocode. -Whit On Wed, Jun 15, 2011 at 7:59 PM, Nicolas Heslot wrote: > Hi, > > Thank you for your quick answer. > Sorry that I did not explain well enought my issue

Re: [Rcpp-devel] Help with an Rcpp and CppBugs example

2011-09-30 Thread Whit Armstrong
Shige, That example is quite dated at this point. The CppBugs api has changed a lot since then and is likely to change more in the near future. Please git pull the latest from github, and ping me if you have any issues. There are also quite a few pure c++ examples the the 'test' dir to get you

Re: [Rcpp-devel] Help with an Rcpp and CppBugs example

2011-10-01 Thread Whit Armstrong
he suggestion. > > Best, > Shige > > On Fri, Sep 30, 2011 at 10:06 PM, Whit Armstrong > wrote: >> Shige, >> >> That example is quite dated at this point.  The CppBugs api has >> changed a lot since then and is likely to change more in the near >> future.

Re: [Rcpp-devel] Help with an Rcpp and CppBugs example

2011-10-01 Thread Whit Armstrong
gs in >      standalone mode as per Whit's examples in hit repo.  Then revisit i) >      and wrap it too. > > Dirk > > | Best, > | Shige > | > | On Sat, Oct 1, 2011 at 1:52 PM, Whit Armstrong > wrote: > | > I'm happy to provide more examples of cppbu

Re: [Rcpp-devel] Help with an Rcpp and CppBugs example

2011-10-01 Thread Whit Armstrong
Thanks, Dirk. Shige, this is still alpha software. Don't expect it to be perfect. As you encounter bugs, please let me know. -Whit On Sat, Oct 1, 2011 at 5:54 PM, Dirk Eddelbuettel wrote: > > On 1 October 2011 at 17:16, Whit Armstrong wrote: > | Please have a look here. > |

Re: [Rcpp-devel] Success with integrating external C++ Code

2011-10-12 Thread Whit Armstrong
if you want it to be inline, then simply copy the contents of the .hpp and .cpp files into your R script and quote them. what the getModel function does is simply read the file into a string. I do it this way because emacs knows how to properly indent the file if I keep it separate (rather than a

Re: [Rcpp-devel] CppBugs vs WinBugs

2011-12-19 Thread Whit Armstrong
post your code. The speedup depends on your model. My comparisons were based on R/JAGS and pymc on linux. -Whit On Mon, Dec 19, 2011 at 7:30 AM, Watson, Samuel wrote: > I am currently using CppBugs with Rcpp through R. I am very interested to > use CppBugs as I am finding WinBugs to be prohi

Re: [Rcpp-devel] CppBugs vs WinBugs

2011-12-19 Thread Whit Armstrong
nty[county.name==uniq[i]] <- i > } > > system.time(radon.model(GR=county22,lev=log.radon2,basm=floor2,iterations=1e4L,burn=1e4L,adapt=2e3L,thin=5L)) > > #its necessary to change the structure of the data files or else winbugs has > an error > log.radon<-as.numeric(log.radon) > floor<-as.numeric(floor) > county<-as.nu

Re: [Rcpp-devel] CppBugs vs WinBugs

2011-12-19 Thread Whit Armstrong
7;t > work out why I can't an equivalent speed to you. > Would you have any other recommendations of things that could be slowing the > model down? > > I am running Windows 7 Enterprise on Intel Core i7-2600 @ 3.4 GHz w/ 8GB DDR3 > RAM > > Many thanks, > Sam Watso

Re: [Rcpp-devel] CppBugs vs WinBugs

2011-12-19 Thread Whit Armstrong
all. > > For the linear model example you provide the difference for me for winbugs vs > cppbugs is 40s vs 10s which is a big difference. > I will test some more models and hopefully this model is just an anomaly for > me. > > Thanks for a great package! > > Sam > >

Re: [Rcpp-devel] CppBugs vs WinBugs

2011-12-19 Thread Whit Armstrong
eloping a way of specifying initial values for each > Markov chain? > > Sam > -Original Message- > From: Whit Armstrong [mailto:armstrong.w...@gmail.com] > Sent: 19 December 2011 18:24 > To: Watson, Samuel > Cc: rcpp-de...@r-forge.wu-wien.ac.at > Subject: Re: [Rcpp

[Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-24 Thread Whit Armstrong
using cxxfunction is there an easy (not using a custom plugin) way to add -std=c++0x to the g++ call? -Whit ___ 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

Re: [Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-24 Thread Whit Armstrong
ersion:0.2.34 Date: $Date: 2011-12-12 16:56:37 -0600 (Mon, 12 Dec 2011) $ Anyway, I'll keep tinkering... -Whit On Tue, Jan 24, 2012 at 3:18 PM, Dirk Eddelbuettel wrote: > > On 24 January 2012 at 14:46, Whit Armstrong wrote: > | using cxxfunction is there an

Re: [Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-24 Thread Whit Armstrong
ue;",settings=cppbugs.plugin) ## this blows up foo.bar <- cxxfunction(signature(hat="numeric"), body="#include \nreturn R_NilValue;",settings=cppbugs.plugin,verbose=TRUE) -Whit On Tue, Jan 24, 2012 at 3:36 PM, Whit Armstrong wrote: > Thanks, Dirk, as always fo

Re: [Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-24 Thread Whit Armstrong
yes, unless I add #include Then it blows up. The problem is in my real function I include a header, which includes armadillo. So, unless I go deleting all the refs to #include , I think it will continue to blow up... (with the current released version). Anyway, I'll just wait for the next re

Re: [Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-24 Thread Whit Armstrong
Thanks for your help. -Whit On Tue, Jan 24, 2012 at 4:39 PM, Dirk Eddelbuettel wrote: > > On 24 January 2012 at 16:27, Whit Armstrong wrote: > | yes, unless I add > | > | #include > | > | Then it blows up. > | > | The problem is in my real function I inclu

Re: [Rcpp-devel] cxxfunction -- extra argument to g++

2012-01-25 Thread Whit Armstrong
") : running ‘make’ failed Execution halted warmstrong@krypton:~/dvl/R.packages/external$ Is this a missing dependency on my workstation? seems to be here too: http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-gcc-fedora/Rcpp-00check.html -Whit On Tue, Jan 24, 2012 at 4:58 PM

Re: [Rcpp-devel] Exposing a large number of C++ classes in R

2016-02-05 Thread Whit Armstrong
I've been thinking for a while about using clang to do source-to-source translation to generate the R bindings for a given c++ class. There are lots of examples online, but I haven't yet tackled this for R. http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang h

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

2016-11-29 Thread Whit Armstrong
Have a look at this project: https://github.com/richfitz/RcppR6 On Mon, Nov 28, 2016 at 11:40 PM, Christian Gunning wrote: > Dear List, > > The following is a general request for advice / comment on modern Rcpp > development best-practices for package & class development. I looked over > the Rc

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

2016-11-30 Thread Whit Armstrong
ules) > offers average users over RefClasses + Rcpp functions, where the RefClass > holds state, and the Rcpp functions operate on the state using by-reference > semantics. > > -Christian > > On Tue, Nov 29, 2016 at 5:33 AM, Whit Armstrong > wrote: > >> Have a look a