I agree. As I said in the original note, I use inline as a
development tool. The point is to be able to develop Rcpp components
for packages in a structured fashion which makes the test and develop
cycle faster.
On Wed, Nov 21, 2012 at 8:00 PM, Dirk Eddelbuettel wrote:
>
> On 21 November 2012 a
On 21 November 2012 at 18:59, John Merrill wrote:
| Is there a way to do this using inline?
Maybe.
I tend to write packages. That is the way we documented, and still recommend.
Dirk
--
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
__
> All to say, it is unclear to me whether the intended use of
> compileAttributes() is solely to help package writers allow package users
> to more easily access the c++ functions at the R layer or additionally to
> also streamline how package developers source c++ files within their own
> package
tl;dr summary -- is there a way to incorporate multiple functions into
an inline call? Specifically, is there a way to include a templated
function in an inline compilation?
Consider the following outline:
template
void InsertTypedVector
}
RcppExport SEXP ExposedFunction(SEXP r_foobar) {
Dat
On 21 November 2012 at 18:36, terrance savitsky wrote:
| Hi, I've read this note a few times and still find myself similarly confused.
Maybe you could take a look at the seven page vignette 'Rcpp-attribute' which
came with your copy of Rcpp 0.10.0.
It should answers these questions of yours.
Hi, I've read this note a few times and still find myself similarly
confused. Does the new compileAttributes() for //[[Rcpp::export]] tagged
functions intend to provide a more streamlined alternative to employment of
RcppExport inclusions in declarations in the header file and subsequent
use of
> | > I believe that such a function is normally called "clamp".
> |
> | I'd not heard that before; is that the mathematical word for it? (clip
> | is terminology from graphics programming, where a clipping rectangle is
> | another word for a window or viewport)
>
> http://en.wikipedia.org/wiki/C
On 22 November 2012 at 09:23, Darren Cook wrote:
| > I believe that such a function is normally called "clamp".
|
| I'd not heard that before; is that the mathematical word for it? (clip
| is terminology from graphics programming, where a clipping rectangle is
| another word for a window or viewp
> I believe that such a function is normally called "clamp".
I'd not heard that before; is that the mathematical word for it? (clip
is terminology from graphics programming, where a clipping rectangle is
another word for a window or viewport)
Darren
__
On 21 November 2012 at 22:24, Martyn Plummer wrote:
| I believe that such a function is normally called "clamp".
I like that too. Shall we change it?
Dirk
--
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com
___
Rcpp-devel mailing
>> By "sugar versions" I meant vacc4() vs. vacc3()
>> (https://gist.github.com/4111256) not pmin() and friends. The vacc4()
>> code looks like:
>>
>>NumericVector p(age.size());
>>p = 0.25 + 0.3 * 1 / (1 - exp(0.04 * age)) + 0.1 * ily;
>>p = p * ifelse(female, 1.25, 0.75);
>>p = pma
> Something like this yes. I was thinking of something that still kept the
> logical split between the dispatcher "unique3" and the workers unique1, so
> essentially have all the unique1 overloads returning SEXP instead of stl
> containers.
Ah, got it. That would make the variable initialisation
Le 21/11/12 22:35, Hadley Wickham a écrit :
I would perhaps advise you to have the unique1 overloads not to return the
stl object, as you are generating copies (although some may argue about
compiler optimizations).
Ah, ok. I don't have much intuition for when copies occur in C++.
I would ad
>> I would perhaps advise you to have the unique1 overloads not to return the
>> stl object, as you are generating copies (although some may argue about
>> compiler optimizations).
>
> Ah, ok. I don't have much intuition for when copies occur in C++.
>
>> I would advise to return include the call
I believe that such a function is normally called "clamp".
Martyn
Quoting Romain Francois :
> clip it is, with this order:
>
> p = clip( 0.0, p, 1.0 ) ;
>
> which I found more natural.
>
> For now, I implemented only a version with primitives for the first and
> last argument and sugar expression
> I would perhaps advise you to have the unique1 overloads not to return the
> stl object, as you are generating copies (although some may argue about
> compiler optimizations).
Ah, ok. I don't have much intuition for when copies occur in C++.
> I would advise to return include the call to wrap
Le 19/11/12 16:31, Hadley Wickham a écrit :
Hi all,
Inspired by "Rcpp is smoking fast for agent-based models in data
frames" (http://www.babelgraph.org/wp/?p=358), I've been doing some
exploration of vectorisation in R vs C++ at
https://gist.github.com/4111256
I have five versions of the basic
clip it is, with this order:
p = clip( 0.0, p, 1.0 ) ;
which I found more natural.
For now, I implemented only a version with primitives for the first and
last argument and sugar expression for the one in the middle, but we can
imagine writing vector versions everywhere.
Romain
Le 21/11/12
How about clip():
p = clip(p, 0.0, 1.0);
Great idea!!!
On Wed, Nov 21, 2012 at 2:00 PM, Romain Francois
wrote:
> Le 21/11/12 13:22, Darren Cook a écrit :
>
> I wrote:
>>
>>> P.S. I don't think the sugar versions can be made any quicker, because
> they have to allocate intermediate vect
Le 21/11/12 13:22, Darren Cook a écrit :
I wrote:
P.S. I don't think the sugar versions can be made any quicker, because
they have to allocate intermediate vectors, and do more memory copies.
By "sugar versions" I meant vacc4() vs. vacc3()
(https://gist.github.com/4111256) not pmin() and frien
I wrote:
>>> P.S. I don't think the sugar versions can be made any quicker, because
>>> they have to allocate intermediate vectors, and do more memory copies.
By "sugar versions" I meant vacc4() vs. vacc3()
(https://gist.github.com/4111256) not pmin() and friends. The vacc4()
code looks like:
N
Le 19/11/12 17:47, Douglas Bates a écrit :
On Mon, Nov 19, 2012 at 9:56 AM, Dirk Eddelbuettel mailto:e...@debian.org>> wrote:
On 19 November 2012 at 09:31, Hadley Wickham wrote:
| Hi all,
|
| Inspired by "Rcpp is smoking fast for agent-based models in data
| frames" (http://
I'll make a more general reply later (this triggered a few findings on
the code).
Le 20/11/12 16:54, Hadley Wickham a écrit :
P.S. I don't think the sugar versions can be made any quicker, because
they have to allocate intermediate vectors, and do more memory copies.
I don't think they _hav
Pretty much.
I would perhaps advise you to have the unique1 overloads not to return
the stl object, as you are generating copies (although some may argue
about compiler optimizations).
I would advise to return include the call to wrap in your unique1.
Things will be different some day when w
24 matches
Mail list logo