Re: [Rcpp-devel] Module with vector of a class with inheritance, how to avoid slicing

2013-04-04 Thread Krzysztof Sakrejda
size(){ return(MyfatherList_.size()); }; >>> >>> void push_back(father func){ >>> MyfatherList_.push_back(XPtr(&func)); >>> }; >>> >>> void push_back_children1_t(children1_t func){ >>> Myfa

Re: [Rcpp-devel] Returning Armadillo matrices with dimnames

2013-05-03 Thread Krzysztof Sakrejda
On May 2, 2013 11:22 PM, "Dirk Eddelbuettel" wrote: > > > On 2 May 2013 at 17:24, Dirk Eddelbuettel wrote: > | Sorry. It was just a quick guess. > | > | On second thought, I think your earlier approach was actually pretty good: > | Take your arma object, use wrap to turn it into a SEXP (or maybe a

Re: [Rcpp-devel] Setting the R random seed from Rcpp

2013-06-07 Thread Krzysztof Sakrejda
On Jun 7, 2013 12:12 PM, "Dirk Eddelbuettel" wrote: > Maybe what you want is more easily done with the RNGs from C++ (esp C++11), > Boost, ... or something different from R. It may work, but we are > (currently) simply not set up for it. If you go with something different from R, I've had good

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Krzysztof Sakrejda
On Jun 11, 2013 12:33 PM, "Steve Jaffe" wrote: > > The problem with External Pointer is that R will not be able to use it as a numeric vector (sfaik). > > What I'm looking for -- and perhaps it is impossible -- would be a way to combine the memory semantics of External Pointer with the value seman

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Krzysztof Sakrejda
umeric', e2='notAVector'), definition = function(e1,e2) return(e2 + e1) ) Then all you have to do is replace the numeric vector member with an "externalptr" member which is an XPtr on the Rcpp side, and implement the operations for the methods. It's a lot of code

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Krzysztof Sakrejda
On Tue, Jun 11, 2013 at 2:49 PM, Romain Francois wrote: > > Le 11 juin 2013 à 20:40, Steve Jaffe a écrit : > >> On Tuesday, June 11, 2013 2:37 PM, Krzysztof Sakrejda wrote: >>>> Would you know of a simple example of writing a "reference class" that >&

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Krzysztof Sakrejda
On Tue, Jun 11, 2013 at 4:10 PM, Steve Jaffe wrote: > On Tuesday, June 11, 2013 3:02 PM, Romain Francois wrote: >> Maintaining the idea that this external pointer acts as a numeric vector >> without being one. >> >> What happens then you want its mean, its quantile or whatever. You >> essentiall

Re: [Rcpp-devel] Unable to load shared object

2013-07-10 Thread Krzysztof Sakrejda
our post where you're at with the Rcpp/C++ combo. Hope that helps, Krzysztof -- Krzysztof Sakrejda Organismic and Evolutionary Biology University of Massachusetts, Amherst 319 Morrill Science Center South 611 N. Pl

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Krzysztof Sakrejda
On Fri, Jul 12, 2013 at 8:50 PM, Dirk Eddelbuettel wrote: > > On 12 July 2013 at 12:28, Neal Fultz wrote: > | I've been updating the C in an r package to use Rcpp and started seeing > | so odd results from a function that samples from a discrete > | distribution. For what it's worth, I can't repr

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-13 Thread Krzysztof Sakrejda
x27;t use debian so testing/unstable don't mean much to me). Krzysztof > > > On Fri, Jul 12, 2013 at 10:25:17PM -0400, Krzysztof Sakrejda wrote: >> On Fri, Jul 12, 2013 at 8:50 PM, Dirk Eddelbuettel wrote: >> > >> > On 12 July 2013 at 12:28, Neal Fultz wro

Re: [Rcpp-devel] Dynamic Wrapping and Recursion with Rcpp - using an R function?

2013-07-26 Thread Krzysztof Sakrejda
> first) >> >> Hadley >> >> -- >> Chief Scientist, RStudio >> http://had.co.nz/ > > > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/

Re: [Rcpp-devel] inconsistent is_na() vs. is.na()

2013-10-02 Thread Krzysztof Sakrejda
On Wed, Oct 2, 2013 at 9:36 AM, Dirk Eddelbuettel wrote: > > On 2 October 2013 at 21:10, Thomas Tse wrote: > | For whatever reason R chose NaN to be a subset of NA_real_, so I think it's > | better for Rcpp (which aims to provide C++ functionality in R) to follow the > | convention of R ... It ma

Re: [Rcpp-devel] Interfacing Rcpp with a C library: memory allocation

2013-11-20 Thread Krzysztof Sakrejda
> R- or Rcpp-specific that I have to keep in mind or should I program as > if I were programming in C/C++? > > Thanks a lot! > > > -- > Alessandro Mammana, PhD Student > Max Planck Institute for Molecular Genetics > Ihnestraße 63-73 > D-14195 Berlin, Germany > __

Re: [Rcpp-devel] Question on lme4 book

2013-12-10 Thread Krzysztof Sakrejda
On Tue, Dec 10, 2013 at 10:00 AM, Kasper Daniel Hansen wrote: > It is basically > impossible to address these issues without a system. It would be great if > someone made a virtual machine with R and everything that I (and others) > could download and test with. Isn't that something one could a

Re: [Rcpp-devel] Copying a NumericVector from a list within a list

2014-04-13 Thread Krzysztof Sakrejda
quot;) > */ > > > -- > Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com > ___ > 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 -- Krz

Re: [Rcpp-devel] Copying a NumericVector from a list within a list

2014-04-13 Thread Krzysztof Sakrejda
Sorry, accidental gmail send... here's what I meant: On Sat, Apr 12, 2014 at 11:06 PM, Dirk Eddelbuettel wrote: > What can work as a single expression in R sometimes needs to be disentangled > at the C++ level to help the compiler find its way through all the templates. > [snip] > > // [[Rcpp::e

Re: [Rcpp-devel] Fwd: Re: Making objects in the C++ "side" persistent

2014-06-17 Thread Krzysztof Sakrejda
> 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 -- Krzysztof Sakrejda Organismic and Evolutionary Biology University of Massachusetts, Amherst 319 Morrill Scien

Re: [Rcpp-devel] Fwd: Re: Making objects in the C++ "side" persistent

2014-06-17 Thread Krzysztof Sakrejda
I would love to know. Krzysztof > > cheers, > > Martin > > -- > Martin Jakt > Department of Systems Medicine > Mitsunada Sakaguchi Laboratory > Keio University School of Medicine -- Krzysztof Sakrejda Organismic and Evolutionary Biology University of Massachusetts,

[Rcpp-devel] Looking for help with an rstan issue...

2014-07-13 Thread Krzysztof Sakrejda
Hi, I'm not sure if this is an Rcpp problem or an rstan problem but reading through the rstan code I don't see a reason why the rstan code should be triggering it... so I'm looking for advice about how to debug it further. I think the right etiquette is to just give a link to the issue, but ple

Re: [Rcpp-devel] optimizing rcpp iterating code

2014-07-16 Thread Krzysztof Sakrejda
pp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Krzysztof Sakrejda Organismic and Evolutionary Biology University of Massachusetts, Amherst 319 Morrill Science Center South 611 N. Pleasant Street A

Re: [Rcpp-devel] statement about rcpp11 ?

2014-09-30 Thread Krzysztof Sakrejda
On Tue, Sep 30, 2014 at 1:43 PM, Jonathon Love wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > thanks for your response romain, > >> If you want to have a private conversation with Dirk, just email >> him directly > > sure, but i expect i'm not the only one interested in his respons

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Krzysztof Sakrejda
Hi Charles, comments inline 2015-06-24 11:03 GMT-04:00 Charles Determan : > The fastLm examples are nice but they don't contain anything relating to > passing an XPtr between functions. Regarding your comment about making an > XPtr around arma::mat 'innards' I'm not sure I fully understand. I t