On 7 January 2012 at 19:02, Romain François wrote:
| Not thinking about a rewrite, just adding e.g. this for int:
|
| template <> inline int as( SEXP x,
| ::Rcpp::traits::r_type_primitive_tag ) {
| return Rf_asInteger( x ) ;
| }
|
| so that we let R's asInteger do the actua
Le 07/01/12 18:55, Dirk Eddelbuettel a écrit :
On 7 January 2012 at 18:40, Romain François wrote:
| Le 07/01/12 18:36, Douglas Bates a écrit :
|> On Sat, Jan 7, 2012 at 10:55 AM, Dirk Eddelbuettel wrote:
|>> On 7 January 2012 at 10:04, Douglas Bates wrote:
|>> | 2012/1/7 Romain François:
|>>
On 7 January 2012 at 18:40, Romain François wrote:
| Le 07/01/12 18:36, Douglas Bates a écrit :
| > On Sat, Jan 7, 2012 at 10:55 AM, Dirk Eddelbuettel wrote:
| >> On 7 January 2012 at 10:04, Douglas Bates wrote:
| >> | 2012/1/7 Romain François:
| >> |> Le 06/01/12 20:46, Douglas Bates a écrit :
Le 07/01/12 18:36, Douglas Bates a écrit :
On Sat, Jan 7, 2012 at 10:55 AM, Dirk Eddelbuettel wrote:
On 7 January 2012 at 10:04, Douglas Bates wrote:
| 2012/1/7 Romain François:
|> Le 06/01/12 20:46, Douglas Bates a écrit :
|>
|>> On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel
wrote:
|
On Sat, Jan 7, 2012 at 10:55 AM, Dirk Eddelbuettel wrote:
>
> On 7 January 2012 at 10:04, Douglas Bates wrote:
> | 2012/1/7 Romain François :
> | > Le 06/01/12 20:46, Douglas Bates a écrit :
> | >
> | >> On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel
> wrote:
> | >>>
> | >>> On 6 January 2012
Le 07/01/12 17:04, Douglas Bates a écrit :
2012/1/7 Romain François:
Le 06/01/12 20:46, Douglas Bates a écrit :
On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettelwrote:
On 6 January 2012 at 12:59, Douglas Bates wrote:
| On Fri, Jan 6, 2012 at 12:39 PM, John Chambers
wrote:
|>The "Rf_
On 7 January 2012 at 10:04, Douglas Bates wrote:
| 2012/1/7 Romain François :
| > Le 06/01/12 20:46, Douglas Bates a écrit :
| >
| >> On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel wrote:
| >>>
| >>> On 6 January 2012 at 12:59, Douglas Bates wrote:
| >>> | On Fri, Jan 6, 2012 at 12:39 PM, John
On 7 January 2012 at 10:04, Douglas Bates wrote:
| 2012/1/7 Romain François :
| > Le 06/01/12 20:46, Douglas Bates a écrit :
| >
| >> On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel wrote:
| >>>
| >>> On 6 January 2012 at 12:59, Douglas Bates wrote:
| >>> | On Fri, Jan 6, 2012 at 12:39 PM, John
2012/1/7 Romain François :
> Le 06/01/12 20:46, Douglas Bates a écrit :
>
>> On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel wrote:
>>>
>>> On 6 January 2012 at 12:59, Douglas Bates wrote:
>>> | On Fri, Jan 6, 2012 at 12:39 PM, John Chambers
>>> wrote:
>>> |> The "Rf_" part of the API in parti
Le 06/01/12 20:46, Douglas Bates a écrit :
On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel wrote:
On 6 January 2012 at 12:59, Douglas Bates wrote:
| On Fri, Jan 6, 2012 at 12:39 PM, John Chambers wrote:
|> The "Rf_" part of the API in particular is ugly and somewhat of an add-on
|> forced
On 6 January 2012 at 13:46, Douglas Bates wrote:
| I didn't make myself clear. What I meant was that it is not possible
| to use asInteger in Rcpp and count on the name being remapped to
| Rf_asInteger.
Right. I had to enforce that a long time ago because the non-prefixed
variants too often clas
On Fri, Jan 6, 2012 at 1:12 PM, Dirk Eddelbuettel wrote:
>
> On 6 January 2012 at 12:59, Douglas Bates wrote:
> | On Fri, Jan 6, 2012 at 12:39 PM, John Chambers
> wrote:
> | > The "Rf_" part of the API in particular is ugly and somewhat of an add-on
> | > forced in a few examples by the use of s
On 6 January 2012 at 12:59, Douglas Bates wrote:
| On Fri, Jan 6, 2012 at 12:39 PM, John Chambers wrote:
| > The "Rf_" part of the API in particular is ugly and somewhat of an add-on
| > forced in a few examples by the use of some common names in the macro files.
|
| But, as it stands, that is a
On Fri, Jan 6, 2012 at 12:39 PM, John Chambers wrote:
> At the risk of derailing this thread into the quicksand of programming style
>
>
> Except when required by the specific application, my preference would be to
> stay with the Rcpp idiom. Mixing in the older C API seems to risk more
> pr
On 6 January 2012 at 10:39, John Chambers wrote:
| At the risk of derailing this thread into the quicksand of programming
| style
Au contraire: thanks for joining in.
| Except when required by the specific application, my preference would be
| to stay with the Rcpp idiom. Mixing in the
At the risk of derailing this thread into the quicksand of programming
style
Except when required by the specific application, my preference would be
to stay with the Rcpp idiom. Mixing in the older C API seems to risk
more programming error. Of course, each application is different and
On 6 January 2012 at 13:00, Steve Lianoglou wrote:
| Hi,
|
| 2012/1/6 Douglas Bates :
| [snip]
| > As I mentioned in another thread, I prefer the idiom
| >
| > int n2 = ::Rf_asInteger(n);
| >
| > because asInteger is part of the R API (in Rcpp it must be called as
| > Rf_asInteger - the :: is a h
Hi,
2012/1/6 Douglas Bates :
[snip]
> As I mentioned in another thread, I prefer the idiom
>
> int n2 = ::Rf_asInteger(n);
>
> because asInteger is part of the R API (in Rcpp it must be called as
> Rf_asInteger - the :: is a hint to the compiler that it will be found
> in the global namespace). F
2012/1/4 Romain François :
> Le 04/01/12 14:29, Hadley Wickham a écrit :
>
>> Hi all,
>>
>> I'm still just getting my feet wet in Rcpp, so please excuse the
>> naivety of my question, but is this the appropriate idiom for treating
>> an input as a C++ scalar?
>>
>> f<- cxxfunction(signature(x = "in
2012/1/4 Hadley Wickham :
>>> And is there a standard for what you call the C++ equivalent of the R
>>> arguments? i.e. x_ = as(x) ?
>>
>> I don't think there's a "standard" per se, but I actually tend to do
>> it the other way, ie. put the trailing slash on the incoming SEXP
>> arguments so that
>> And is there a standard for what you call the C++ equivalent of the R
>> arguments? i.e. x_ = as(x) ?
>
> I don't think there's a "standard" per se, but I actually tend to do
> it the other way, ie. put the trailing slash on the incoming SEXP
> arguments so that my c(++) code is a bit less tedi
Hi,
2012/1/4 Hadley Wickham :
>> We have "as" for this, and wrap for the other way around:
>>
>> f<- cxxfunction(signature(x = "integer"), plugin = "Rcpp", '
>> int x2 = as(x) ;
>>
>> return wrap(x2) ;
>> ')
>
> Got it - thanks!
>
> And is there a standard for what you call the C++ equivalent of
> We have "as" for this, and wrap for the other way around:
>
> f<- cxxfunction(signature(x = "integer"), plugin = "Rcpp", '
> int x2 = as(x) ;
>
> return wrap(x2) ;
> ')
Got it - thanks!
And is there a standard for what you call the C++ equivalent of the R
arguments? i.e. x_ = as(x) ?
Hadley
Le 04/01/12 14:29, Hadley Wickham a écrit :
Hi all,
I'm still just getting my feet wet in Rcpp, so please excuse the
naivety of my question, but is this the appropriate idiom for treating
an input as a C++ scalar?
f<- cxxfunction(signature(x = "integer"), plugin = "Rcpp", '
Rcpp::IntegerVect
Hi all,
I'm still just getting my feet wet in Rcpp, so please excuse the
naivety of my question, but is this the appropriate idiom for treating
an input as a C++ scalar?
f <- cxxfunction(signature(x = "integer"), plugin = "Rcpp", '
Rcpp::IntegerVector x1(x);
int x2 = x1[0];
return(Rcpp::Nu
25 matches
Mail list logo