similar to: Problem with .C

Displaying 20 results from an estimated 3000 matches similar to: "Problem with .C"

2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
Rcpp version 0.7.0 went onto CRAN this weekend. The key new features are o inline support, taken from Oleg Sklyar's neat inline package and adapted/extented to support Rcpp as well as external libraries (see below for an example); this even works on Windows (provided you have Rtools installed and configured); o addition of a new simple type RcppSexp for importing or
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
Rcpp version 0.7.0 went onto CRAN this weekend. The key new features are o inline support, taken from Oleg Sklyar's neat inline package and adapted/extented to support Rcpp as well as external libraries (see below for an example); this even works on Windows (provided you have Rtools installed and configured); o addition of a new simple type RcppSexp for importing or
2010 Apr 13
3
Inline Package: void vs return type functions
Dear all, After having a look at the "inline" package and also going through the "Rcpp" package which is tighty related to it, it came to me this question: 1) my C/ C++ code has a return type (let say a double[][] or a user define class) 2) I am working with an extensive library built by someone else and I don't have the time/knowledge to change it by means of working
2010 May 17
0
Rcpp 0.8.0 on CRAN
===== Summary ===== Version 0.8.0 of the Rcpp package was released to CRAN today. This release marks another milestone in the ongoing redesign of the package, and underlying C++ library. ===== Overview ===== Rcpp is an R package and C++ library that facilitates integration of C++ code in R packages. The package features a set of C++ classes (Rcpp::IntegerVector, Rcpp::Function,
2010 May 17
0
Rcpp 0.8.0 on CRAN
===== Summary ===== Version 0.8.0 of the Rcpp package was released to CRAN today. This release marks another milestone in the ongoing redesign of the package, and underlying C++ library. ===== Overview ===== Rcpp is an R package and C++ library that facilitates integration of C++ code in R packages. The package features a set of C++ classes (Rcpp::IntegerVector, Rcpp::Function,
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
Hello, As this little program illustrates, duplicating a STRSXP does not seem deep enough. require( inline ) fx <- cfunction( signature( x = "character"), ' SEXP y = PROTECT( duplicate( x ) ); int n = LENGTH(x); int nc = 0 ; char* p = 0 ; for( int i=0; i<n; i++){ p = (char*)( CHAR( STRING_ELT( y , i ) ) ); nc = strlen( p ) ; for( int j=0; j<nc; j++){ p[j] =
2013 Feb 01
1
Problem using raw vectors with inline cfunction
Hello, >From what I understood from the documentation I found, when using the inline cfunction with convention=".C", R raw vectors should be given as unsigned char* to the C function. But consider the following script: library(inline) testRaw <- cfunction(signature(raw='raw', len='integer') , body=' int l = *len; int i = 0;
2010 Nov 28
1
faster base::sequence
Hello, Based on yesterday's R-help thread (help: program efficiency), and following Bill's suggestions, it appeared that sequence: > sequence function (nvec) unlist(lapply(nvec, seq_len)) <environment: namespace:base> could benefit from being written in C to avoid unnecessary memory allocations. I made this version using inline: require( inline ) sequence_c <- local( {
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
2015 May 13
3
Alternative for wildcard gnu extension in Makevars
Dirk Eddelbuettel <edd at debian.org> schreef: > On 13 May 2015 at 17:27, Jan van der Laan wrote: > | > | I have some cpp-files from another library (boost) in a subdirectory > | in my src directory (src/boost_src). I include these using the > | following two lines in my Makevars: > | > | SOURCES = $(wildcard *.cpp boost_src/*.cpp) > | OBJECTS = $(SOURCES:.cpp=.o)
2012 Mar 17
1
how to pass 'raw' values with cfunction()?
I am having trouble handing "raw" data to a C function, using "cfunction", as demonstrated in the function and output pasted below. Can anyone suggest what I'm doing incorrectly? Thanks. Dan Kelley [Dalhousie University]. 1. TEST FILE library(inline) code <- 'Rprintf("inside f(), b is 0X%x\\n", *b);' f <-
2019 Sep 15
2
REprintf could be caught by tryCatch(message)
Dear R-devel community, There appears to be an inconsistency in R C API about the exceptions that can be raised from C code. Mapping of R C funs to corresponding R functions is as follows. error -> stop warning -> warning REprintf -> message Rprintf -> cat Rprint/cat is of course not an exception, I listed it just for completeness. The inconsistency I would like to report is
2011 Nov 02
1
can one modify array in R memory from C++ without copying it?
Hi, guys. I posted this by accident at rcpp-dev, although it meant to be only to r-dev, so don't flame me here please, rcpp guys will do it there, i am sure :). I have some pretty large arrays in R and i wanted to do some time consuming modifications of these arrays in C++ without actually copying them, just by passing pointers to them. Since i don't know internal data structures of R, i
2019 Sep 15
0
[External] REprintf could be caught by tryCatch(message)
On Sun, 15 Sep 2019, Jan Gorecki wrote: > Dear R-devel community, > > There appears to be an inconsistency in R C API about the exceptions > that can be raised from C code. > Mapping of R C funs to corresponding R functions is as follows. > > error -> stop > warning -> warning > REprintf -> message This is wrong: REpintf is like cat with file = stderr().
2019 Sep 16
0
[External] REprintf could be caught by tryCatch(message)
You can file it as a wishlist item in the bug trackign system. Without a compelling case or a complete and well tested patch or both I doubt it will rise to the top of anyone's priority list. Best, luke On Sun, 15 Sep 2019, Jan Gorecki wrote: > Thank you Luke for prompt reply. > Is it possible then to request a new function to R C API "message" > that would equivalent to
2014 Oct 31
3
ScalarLogical and setAttrib
Is it expected that attributes set on a LGLSXP created by ScalarLogical will apply to all future objects created by ScalarLogical as well? For example: the 'test1' function below returns FALSE and 'test2' returns FALSE with an attribute: library(inline) test1 <- cfunction(body = 'return ScalarLogical(0);') test2 <- cfunction(body = ' SEXP success =
2019 Sep 15
2
[External] REprintf could be caught by tryCatch(message)
Thank you Luke for prompt reply. Is it possible then to request a new function to R C API "message" that would equivalent to R "message" function? Similarly as we now have C "warning" and C "error" functions. Best, Jan On Sun, Sep 15, 2019 at 5:25 PM Tierney, Luke <luke-tierney at uiowa.edu> wrote: > > On Sun, 15 Sep 2019, Jan Gorecki wrote:
2020 Jun 30
3
Build a R call at C level
On 6/30/20 1:06 PM, Jan Gorecki wrote: > It is quite known that R documentation on R C api could be improved... Please see "5.11 Evaluating R expressions from C" from "Writing R Extensions" Best Tomas > Still R-package-devel mailing list should be preferred for this kind > of questions. > Not sure if that is the best way, but works. > > call_to_sum <-
2015 May 13
4
Alternative for wildcard gnu extension in Makevars
One other solution that's only a little crazy: you could have a R function within your package that generates the appropriate (portable) Makevars, and within the package `configure` script call that function. For example" R --vanilla --slave -e "source('R/makevars.R'); makevars()" And that 'makevars()' function could generate portable
2012 Nov 25
0
Problema de compilacion con Rcpp
Hola, necesito compilar un programa de tipo source (Rstan) con c++ La propia web del programa indica como hacerlo con Rcpp. Sin embargo no consigo que funcione Rcpp ni con un ejemplo básico. He seguido las instrucciones que vienen en http://tonybreyal.wordpress.com/2011/12/07/installing-rcpp-on-windows-7-for-r-and-c-integration/ Tengo instalado Rtools y los paths correspondientes, pero no