Displaying 20 results from an estimated 400 matches similar to: "Is there any way to check the class of an ALTREP?"
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
Benjamin,
You happened to send a link which points to the OP's own package :) I
think Jiefei would like to know how one can "officially" determine if an
arbitrary ALTERP object belongs to a class that he owns.
Regards,
Denes
On 10/19/20 10:22 AM, Benjamin Christoffersen wrote:
> It seems as if you can you use the ALTREP macro as done in this
> package:
2020 Oct 19
1
Is there any way to check the class of an ALTREP?
Thank Denes for the clarification, glad to see my package got one citation
from my own question:) Also, thank Benjamin
for sending many useful documents.
Actually, the question is related to the SharedObject package that Benjamin
has pointed to. I wanna
avoid sharing an object that has already been shared, so I need to check
whether an object is an ALTREP
that is defined in my package. Since the
2020 Oct 19
0
Is there any way to check the class of an ALTREP?
> You happened to send a link which points to the OP's own package :) I
> think Jiefei would like to know how one can "officially" determine if an
> arbitrary ALTERP object belongs to a class that he owns.
Argh, I am sorry! I did not notice that. My best bet for what I
thought the question was is section 1.1.2 of R Internals where they
note that: `unsigned int alt : 1; /* is
2020 Oct 19
0
Is there any way to check the class of an ALTREP?
It seems as if you can you use the ALTREP macro as done in this
package: https://github.com/Jiefei-Wang/SharedObject/blob/804b6ac58c63a4bae95343ab43e8b1547b07ee6b/src/C_interface.cpp#L185
and in base R: https://github.com/wch/r-source/blob/54fbdca9d3fc63437d9e697f442d32732fb4f443/src/include/Rinlinedfuns.h#L118
The macro is defined here in Rinternals.h:
2019 May 16
3
ALTREP: Bug reports
Hello,
I have encountered two bugs when using ALTREP APIs.
1. STDVEC_DATAPTR
>From RInternal.h file it has a comment:
/* ALTREP support */
> void *(STDVEC_DATAPTR)(SEXP x);
However, this comment might not be true, the easiest way to verify it is to
define a C++ function:
void C_testFunc(SEXP a)
> {
> STDVEC_DATAPTR(a);
> }
and call it in R via
> a=1:10
> >
2019 May 16
3
ALTREP: Bug reports
Hello Luke and Gabriel,
Thank you very much for your quick responses. The explanation of STDVEC is
very helpful and I appreciate it! For the wrapper, I have a few new
questions.
1. Like Luke said a mutable object is not possible. However, I noticed that
there is one extra argument *deep* in the function duplicate. I've googled
all the available documentation for ALTREP but I did not find
2018 Oct 08
4
R_ext/Altrep.h should be more C++-friendly
I am not able to #include "R_ext/Altrep.h" from a C++ file. I think
it needs two changes:
1. add the same __cplusplus check as most of the other header files:
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
2. change the line
R_new_altrep(R_altrep_class_t class, SEXP data1, SEXP data2);
to
2019 Jul 30
2
Questions regarding ALTREP_SET_ELT APIs
Hi all,
I'm wondering if there is any way to define a `SET_ELT` function for an
ALTREP class? I see there are ` ALTINTEGER_SET_ELT` etc. functions exported
in Rinternal.h, but there is no corresponding ALTREP APIs to define them.
The only way to set the value of an ALTREP is through a pointer, which will
require that the ALTREP data is in memory. Is it on purpose? Will there be
any plan to
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 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); *
2019 Sep 03
2
[ALTREP] What is the meaning of the return value of Is_sorted and No_NA function?
Hi,
I would like to figure out the meaning of the return value of these two
functions. Here are the default definitions I find from R source code:
static int altreal_Is_sorted_default(SEXP x) { return UNKNOWN_SORTEDNESS; }
static int altreal_No_NA_default(SEXP x) { return 0; }
I guess the macro *UNKNOWN_SORTEDNESS *in *Is_sorted* and 0 in *No_NA
*simply means
unknown sorted/NA status of
2019 Sep 24
2
What is the best way to loop over an ALTREP vector?
Hi Bob,
Thanks for sending around the link to that. It looks mostly right and looks
like a useful onramp. There are a few things to watch out for though (I've
cc'ed Romain so he's aware of these comments). @romain I hope you taake the
following comments as they are intended, as help rather than attacks.
The largest issue I see is that the contract for Get_region is that it
*populates
2020 Mar 10
4
R CMD INSTALL cannot recognize full path on Windows
Oops, I think both of us forget to cite the r-devel channel.
Best,
Jiefei
On Tue, Mar 10, 2020 at 5:13 AM Wang Jiefei <szwjf08 at gmail.com> wrote:
> Thanks for your quick response, Tomas.
>
> Yes, this is a path issue, I think the problem is related to R, not the
> Rtools make. I built an example package for reproducing the problem:
> https://github.com/Jiefei-Wang/example
2020 Oct 07
2
Coercion function does not work for the ALTREP object
Hi all,
The coercion function defined for the ALTREP object will not be called by R
when an assignment operation implicitly introduces coercion for a large
ALTREP object.
For example, If I create a vector of length 10, the ALTREP coercion
function seems to work fine.
```
> x <- 1:10
> y <- wrap_altrep(x)
> .Internal(inspect(y))
@0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am
2020 Oct 08
1
Coercion function does not work for the ALTREP object
Hi Gabriel, here is a simple package for reproducing the problem.
https://github.com/Jiefei-Wang/testPkg
Best,
Jiefei
On Thu, Oct 8, 2020 at 5:04 AM Gabriel Becker <gabembecker at gmail.com> wrote:
> Jiefei,
>
> Where does the code for your altrep class live?
>
> Thanks,
> ~G
>
> On Wed, Oct 7, 2020 at 4:25 AM Jiefei Wang <szwjf08 at gmail.com> wrote:
>
2009 Dec 13
1
How to resolve include Rcpp.h problems?
Hi,
I am Linux Ubuntu 9.04 user. I'm using R-2.6.
Actually, I am developing R package for reading/writing 3D images. I needed
to use the R package Rcpp in order to make profit of available C/C++ codes.
My problem is that my C code is not able to include the Rcpp.h
In fact, when I run this command R CMD build rply, I got the following error
message in the file
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all,
I found that the finalizer of the externalPtr is not called when R is
quitting. However, manually calling GC() works fine. This behavior is
observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make
a reproducible package here: https://github.com/Jiefei-Wang/example
Here is the detail of how to reproduce the problem, I create a temporary
file in the package root path and
2020 Mar 11
1
R CMD INSTALL cannot recognize full path on Windows
Jiefei,
you did not commit all files into the example package - your example has things like RcppExports.cpp as well as additional flags which are not in your GH project. I suspect the issue is with the extra flags you're adding - those don't come from R. Please make sure you can replicate the issue with the GH package you created.
Cheers,
Simon
* installing *source* package
2012 Nov 14
2
[LLVMdev] Linking Clang with an optional external library
Hi,
I'd like to link Clang against the STP theorem prover. Since Clang is built by the LLVM build system, I hope this is the correct place to ask for advice.
The attached patch allows me to pass `configure` a --with-stp option and provide a path to the install prefix for STP. However, I am not familiar with autoconf, so I am not confident that my changes are the correct way to do this. I
2020 Sep 13
2
Thread-safe R functions
Hi,
I am curious about whether there exist thread-safe functions in
`Rinternals.h`. I know that R is single-threaded designed, but for the
simple and straightforward functions like `DATAPTR` and `INTEGER_GET_REGION`,
are these functions safe to call in a multi-thread environment?
Best,
Jiefei
[[alternative HTML version deleted]]