similar to: changes in R-devel and zero-extent objects in Rcpp

Displaying 20 results from an estimated 3000 matches similar to: "changes in R-devel and zero-extent objects in Rcpp"

2024 Jun 08
1
changes in R-devel and zero-extent objects in Rcpp
IMHO, this should be changed in both Rcpp and downstream packages: 1. Rcpp could check for out-of-bounds accesses in cases like these, and emit an R warning / error when such an access is detected; 2. The downstream packages unintentionally making these out-of-bounds accesses should be fixed to avoid doing that. That is, I think this is ultimately a bug in the affected packages, but Rcpp could
2024 Jun 08
1
changes in R-devel and zero-extent objects in Rcpp
The ASAN errors occur *even if the zero-length object is not actually accessed*/is used in a perfectly correct manner, i.e. it's perfectly legal in base R to define `m <- numeric(0)` or `m <- matrix(nrow = 0, ncol = 0)`, whereas doing the equivalent in Rcpp will (now) lead to an ASAN error. i.e., these are *not* previously cryptic out-of-bounds accesses that are now being
2024 Jun 09
1
[External] Re: changes in R-devel and zero-extent objects in Rcpp
On Sat, 8 Jun 2024, Ben Bolker wrote: > The ASAN errors occur *even if the zero-length object is not actually > accessed*/is used in a perfectly correct manner, i.e. it's perfectly legal in > base R to define `m <- numeric(0)` or `m <- matrix(nrow = 0, ncol = 0)`, > whereas doing the equivalent in Rcpp will (now) lead to an ASAN error. > > i.e., these are *not*
2024 Jun 09
1
[External] Re: changes in R-devel and zero-extent objects in Rcpp
Sorry to ask about a bit drifted topic, but will there be an alternative API to DATAPTR? > DATAPTR is not in the API and can't be at least in this form I believe it's vital for ALTREP to return the pointer to the expanded version of a SEXP just like the implementation in base R does [1]. At least, VECSXP has no other measure to expose the pointer if I understand correctly. Best,
2024 Jun 10
1
changes in R-devel and zero-extent objects in Rcpp
> Date: Sat, 8 Jun 2024 19:16:22 -0400 > From: Ben Bolker <bbolker at gmail.com> > > The ASAN errors occur *even if the zero-length object is not actually > accessed*/is used in a perfectly correct manner, i.e. it's perfectly > legal in base R to define `m <- numeric(0)` or `m <- matrix(nrow = 0, > ncol = 0)`, whereas doing the
2013 May 14
2
invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.
Dear R-Developers, I just started learning how to use Rcpp. Earlier while using it, I encountered an error as shown below: file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::Function, Rcpp::Function)’: file74d8254b96d4.cpp:10: error: invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ make: ***
2010 Dec 03
1
Error using Rcpp under windows xp
Hi, I am a newbie to Rcpp packages, and got problems in having basic set-ups for Rcpp under windows xp. Here is the list I have done. 1) installed Rtools and have no problem in compiling .c file. 2) installed Rcpp packages 3) set enviroment variables 'path' to make C:\Program Files\R\R-2.12.0\library\Rcpp\include\ searchable The sample C++ code I used is from the original website:
2017 Dec 03
2
Rcpp, dyn.load and C++ problems
On 3 December 2017 at 05:23, Eric Berger <ericjberger at gmail.com> wrote: > > Do a search on "Rcpp calling C++ functions from R" > Thanks. However search for "Rcpp calling C++ functions from R" gives a lot of result but I think some of them are outdated and others don't agree with each other. Can you point to a specific good on-line guide for me? Regards
2010 Mar 25
1
Error using Rcpp
Hi, Im not sure if this is the right place to post this. I am using Xubuntu Karmic Koala and am trying to use the Rcpp package. I am testing it using a simple code that takes in a vector and adds 1 to each element: #include <Rcpp.h> // This file takes in a vector and adds one to each entry RcppExport SEXP addone(SEXP vec){ // create a local copy of vec Rcpp::NumericVector
2017 Dec 03
1
Rcpp, dyn.load and C++ problems
On 3 December 2017 at 20:19, Dirk Eddelbuettel <edd at debian.org> wrote: Hi Dirk, Thanks for your answers. I got a few more questions. > > 0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read > this and would have missed this were it not for luck. OK. I did found the rcpp-devel mailing-list. But I though it was a developers of the rcpp-package. So it is ok
2011 Sep 09
1
Saving Rcpp Objects for Future Use
Hello, I have recently been doing some research regarding how to successfully save and load Rcpp Objects ( objects from modules ) for future use, but with little success. For example, to use the example package (from package skeleton) in Rcpp: >library(Rcpp) >Rcpp.package.skeleton("rdevelhelp", module=TRUE) ... > q() // install rdevelhelp using R CMD INSTALL // load new R
2014 Oct 30
2
Trouble installing Rcpp on AIX - missing "execinfo.h"
Greetings, When I try "install.packages('Rcpp')" it fails when compiling api.cpp (line 39). This is Rcpp 0.11.3. I searched my filesystem, and indeed I do not have execinfo.h anywhere. After some effort, I got R build on AIX. Now I am trying to build the packages I need. Rcpp is crucial. I first build R with the native IBM XL compilers, and Rcpp wouldn't build. That was
2011 Jun 02
2
Export a function from RCPP in R of type double
Hello to everyone I have written a small c++ function of type double function(double,double); and i want to export it in R using RCPP. After some trials i have realized that the only way i could do it working is to declare the function as void function (double x, double y, double result) and pass the result with RCPP Can you please tell me if this is the only way out? And if this is the case how
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
I would go to the source, in this case Dirk Eddelbuettel's (I hope I spelled it correctly) documentation for Rcpp: http://dirk.eddelbuettel.com/code/rcpp/Rcpp-attributes.pdf Note that you need to do sourceCpp("logistic_map.cpp") in R instead of building and dyn.load()-ing the object. HTH, Peter On Sun, Dec 3, 2017 at 11:04 AM, Martin M?ller Skarbiniks Pedersen <traxplayer
2012 Dec 05
1
RInside, rcpp compilation problem
I have spent some hours browsing the RInside and rcpp documentation, lots of it; but ... as a programmer of C++ since 1990, on both Windows and Unix ... ( Solaris and Ubuntu, and Mandrake/Mandrivo Linux); I see a minor problem ...... Where is the rcpp.h header file?? The below code fails to compile as the RInside.h header file references the rcpp.h header file, which is not included with
2011 Sep 13
1
Getting Rcpp SEXP data in C++
Friends I am looking at Rcpp and I am a bit stuck on a simple matter. (I am calling R from c++, if there is a better way...) Given this simple example using the TTR package and the SMA function which returns a simple moving average.... Rcpp::NumericVector rv; for(int i = 0; i < 100; i++){ rv.push_back(rand()); } Rcpp::Environment TTR("package:TTR");
2015 Nov 03
1
Fwd: Rcpp sugar dpois
Hi. Here is a piece of cpp code. It works, but I do not understand the rational for the use of "R::dpois" to call the function dpois since in the examples I have always found directly "dpois" or "Rcpp::dpois" that both do not work in my code. Could anyone be so patient to explain me why should it be like that? Thaks a lot, Enrico #include <Rcpp.h> using
2011 Jun 09
1
Rcpp and Object Factories
Hello, I'm not exactly sure how to ask this question, but let me give it a shot... Is it possible (easy) to use Rcpp Modules in conjunction with object factories? For example what I am trying to do is something like this: // c++ classes class Foo { public: void do_something() {}; }; class Foo_Factory { public: Foo * create_foo() { return new Foo(); } }; ## R Code
2017 Dec 18
2
Rcpp - Linking to DLL from another package?
Hi, I am trying to make a package B that extends another package A. Package A uses Rcpp, and I want to extend a class X used there. So package A has src/X.h and inst/include/X.h class X { ... } src/X.cpp X::X( arguments ) { ... } My package B wants to do this: DESCRIPTION [...] LinkingTo: Rcpp, RcppArmadillo, A Imports: Rcpp, RcppArmadillo, A src/Y.h class Y: public X { ... } src/Y.cpp
2011 Apr 14
1
Rcpp segmentation faults on the simplest code
Hi all, I'm new to R and Rcpp, and I'm trying to learn Rcpp with the simplest code possible. My goal is to be able to call R functions from C++. The code I'm trying to run is: #include #include #include #include int main(int argc, char* argv[]) { Rcpp::NumericVector v(1); return 0; } It compiles and links fine. However, as soon as I run it, it segfaults. The following is