Displaying 15 results from an estimated 15 matches for "itermacros".
2019 Oct 23
2
Unexpected behavior when using macro to loop over vector
Hi all,
I found an unexpected behavior when I was trying to use the macro defined
in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a minimum
example:
C++ code
```
#include "R_ext/Itermacros.h"
#define GET_REGION_BUFSIZE 2
//Redefine the macro since C++ is not happy with the implicit type
conversion
#define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \
str...
2019 Oct 25
2
Unexpected behavior when using macro to loop over vector
On 10/25/19 11:01 AM, Tomas Kalibera wrote:
> On 10/23/19 6:45 AM, Wang Jiefei wrote:
>> Hi all,
>>
>> I found an unexpected behavior when I was trying to use the macro
>> defined
>> in "R_ext/Itermacros.h"? to loop over an atomic vector. Here is a
>> minimum
>> example:
>>
>> C++ code
>> ```
>> #include "R_ext/Itermacros.h"
>> #define GET_REGION_BUFSIZE 2
>> //Redefine the macro since C++ is not happy with the implicit type
>> c...
2019 Oct 25
0
Unexpected behavior when using macro to loop over vector
On 10/23/19 6:45 AM, Wang Jiefei wrote:
> Hi all,
>
> I found an unexpected behavior when I was trying to use the macro defined
> in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a minimum
> example:
>
> C++ code
> ```
> #include "R_ext/Itermacros.h"
> #define GET_REGION_BUFSIZE 2
> //Redefine the macro since C++ is not happy with the implicit type
> conversion
> #define ITERATE_BY_REGION_P...
2019 Oct 25
0
Unexpected behavior when using macro to loop over vector
...kalibera at gmail.com>
wrote:
> On 10/25/19 11:01 AM, Tomas Kalibera wrote:
> > On 10/23/19 6:45 AM, Wang Jiefei wrote:
> >> Hi all,
> >>
> >> I found an unexpected behavior when I was trying to use the macro
> >> defined
> >> in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a
> >> minimum
> >> example:
> >>
> >> C++ code
> >> ```
> >> #include "R_ext/Itermacros.h"
> >> #define GET_REGION_BUFSIZE 2
> >> //Redefine the macro since C++ is not...
2019 Sep 23
2
What is the best way to loop over an ALTREP vector?
Sorry for post a lot of things, for the first part of code, I copied my C++
iter macro by mistake(and you can see an explicit type casting). Here is
the macro definition from R_exts/Itermacros.h
#define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \
strt, nfull, expr) do { \
* const** etype *px = DATAPTR_OR_NULL(sx); * \
if (px != NULL) { \
R_xlen_t...
2019 Sep 24
2
What is the best way to loop over an ALTREP vector?
...ep 23, 2019, at 3:17 PM, Wang Jiefei <szwjf08 at gmail.com> wrote:
> >
> > Sorry for post a lot of things, for the first part of code, I copied my
> C++
> > iter macro by mistake(and you can see an explicit type casting). Here is
> > the macro definition from R_exts/Itermacros.h
> >
> > #define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \
> >
> > strt, nfull, expr) do { \
> >
> > * const** etype *px = DATAPTR_OR_NULL(sx); *
> \
> >
> > if (px !=...
2019 Aug 28
3
What is the best way to loop over an ALTREP vector?
Hi devel team,
I'm working on C/C++ level ALTREP compatibility for a package. The package
previously used pointers to access the data of a SEXP, so it would not work
for some ALTREP objects which do not have a pointer. I plan to rewrite the
code and use functions like get_elt, get_region, and get_subset to access
the values of a vector, so I have a few questions for ALTREP:
1. Since an
2019 Sep 24
0
What is the best way to loop over an ALTREP vector?
...C++ w/ALTREP.
> On Sep 23, 2019, at 3:17 PM, Wang Jiefei <szwjf08 at gmail.com> wrote:
>
> Sorry for post a lot of things, for the first part of code, I copied my C++
> iter macro by mistake(and you can see an explicit type casting). Here is
> the macro definition from R_exts/Itermacros.h
>
> #define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \
>
> strt, nfull, expr) do { \
>
> * const** etype *px = DATAPTR_OR_NULL(sx); * \
>
> if (px != NULL) {...
2018 Aug 13
1
vector arithmetic
I'm looking for where in the source recycling and vector multiplication+addition are defined. I see some stuff in ~/src/main/arithmetic.c.
Is there anywhere else I should be looking as well?
Cheers
--
isomorphisms at sdf.org
SDF Public Access UNIX System - http://sdf.org
2019 Jun 04
2
[External] undefined symbol errors when compiling package using ALTREP API
...y designed to refuse to give you a full DATAPTR), but with
> ALTREP in place its no longer what you want to do.
>
> That said, you don't want to check whether something is an ALTREP yourself
> and branch your code, what you want to do is use the ITERATE_BY_REGION
> macro in R_ext/Itermacros.h for ALL SEXPs, which will be nearly as for
> standard vectors and work safely for ALTREP vectors.
>
> Basically any time you find yourself wanting to check if something is an
> ALTREP and if so, call a specific ALT*_BLAH method, the intention is that
> there should be a universal A...
2019 Jun 04
2
[External] undefined symbol errors when compiling package using ALTREP API
thanks for clearing that up, so these methods are actually not meant to be
exported on Windows and OSX?
Some of the ALTREP methods that now use 'attribute_hidden' would be very
useful to packages that aim to be ALTREP aware, should the currently
(exported) API be considered final?
thanks for your time & best,
Mark
On Tue, Jun 4, 2019 at 6:52 PM Tierney, Luke <luke-tierney at
2019 Jan 05
1
unsorted - suggestion for performance improvement and ALTREP support for POSIXct
I believe the performance of isUnsorted() in sort.c could be improved by
calling REAL() once (outside of the for loop), rather than calling it twice
inside the loop. As an aside, it is implemented in the faster way in
doSort() (sort.c line 401). The example below shows the performance
improvement for a vectors of double of moving REAL() outside the for loop.
# example as implemented in
2019 Jun 04
0
[External] undefined symbol errors when compiling package using ALTREP API
...ALTREP
being specifically designed to refuse to give you a full DATAPTR), but with
ALTREP in place its no longer what you want to do.
That said, you don't want to check whether something is an ALTREP yourself
and branch your code, what you want to do is use the ITERATE_BY_REGION
macro in R_ext/Itermacros.h for ALL SEXPs, which will be nearly as for
standard vectors and work safely for ALTREP vectors.
Basically any time you find yourself wanting to check if something is an
ALTREP and if so, call a specific ALT*_BLAH method, the intention is that
there should be a universal API point you can call wh...
2019 Sep 23
0
What is the best way to loop over an ALTREP vector?
...ver all SEXPs, which supports both altrep and
>> nonaltrep objects is, with the ITERATE_BY_REGION (which has been in R for a
>> number of released versions, at least since 3.5.0 I think) and the much
>> newer (devel only) ITERATE_BY_REGION_PARTIAL macros defined in
>> R_exts/Itermacros.h
>>
>> The meaning of the arguments is as follows for ITERATE_BY_REGION_PARTIAL
>> are as follows (ITERATE_BY_REGION is the same except no strt, and nfull).
>>
>>
>> - sx - C level variable name of the SEXP to iterate over
>> - px - variable name to...
2019 Jun 05
0
[External] undefined symbol errors when compiling package using ALTREP API
...to give you a full DATAPTR), but with
>> ALTREP in place its no longer what you want to do.
>>
>> That said, you don't want to check whether something is an ALTREP yourself
>> and branch your code, what you want to do is use the ITERATE_BY_REGION
>> macro in R_ext/Itermacros.h for ALL SEXPs, which will be nearly as for
>> standard vectors and work safely for ALTREP vectors.
>>
>> Basically any time you find yourself wanting to check if something is an
>> ALTREP and if so, call a specific ALT*_BLAH method, the intention is that
>> there sho...