Displaying 20 results from an estimated 110 matches similar to: "call R function in c++ program"
2019 Apr 05
2
Parsing code with newlines
Hello!
This is my first post here. I came across the very same problem.
It can be reproduced within modified tests/Embedding/RParseEval.c
Actually this example has another issue, namely it doesn't wrap
everything in R_ToplevelExec . This is a major show stopper for
newcomers as that function is barely mentioned anywhere and longjmp into
terminated setuploop function followed by R_suicide
2019 Apr 10
0
Parsing code with newlines
On 4/5/19 8:14 AM, Mikhail Titov wrote:
> Hello!
>
> This is my first post here. I came across the very same problem.
> It can be reproduced within modified tests/Embedding/RParseEval.c
Please check https://www.r-project.org/posting-guide.html and update
your post if you still need to get help here - from your current post I
am not sure what you did, what was the error you got and
2009 May 18
0
About " Error: C stack usage is too close to the limit"
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc say,
but it still does not work.
it is interesting that if i put the R code in the main
2009 May 19
0
About " Error: C stack usage is too close to the limit"--resend
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc say,
but it still does not work.
it is interesting that if i put the R code in the main
2009 May 19
2
About " Error: C stack usage is too close to the limit"
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-exts doc say,
but it still does not work, the error info still exist.
Besides it is interesting that if i
2019 Apr 10
1
Parsing code with newlines
On Wed, Apr 10, 2019 at 5:06 AM, Tomas Kalibera <tomas.kalibera at gmail.com> wrote:
>> This is my first post here. I came across the very same problem.
>> It can be reproduced within modified tests/Embedding/RParseEval.c
>
> Please check https://www.r-project.org/posting-guide.html and update
> your post if you still need to get help here - from your current post
>
2008 Nov 06
2
Fwd: SWIG with R and C++ STL
Hi, all
I didn't get any response from swig for my question.
see if I can get some help here
Thanks
---------- Forwarded message ----------
From: charlie <charlie.xia.fdu@gmail.com>
Date: Tue, Nov 4, 2008 at 1:55 PM
Subject: SWIG with R and C++ STL
To: swig-user@lists.sourceforge.net
Hi all,
I am new to SWIG. I encountered some problem when I try to SWIG to R some
C++ modules.
Here
2017 Feb 09
4
help me understand how nounwind attribute on functions works?
> On Feb 8, 2017, at 12:58 PM, Reid Kleckner via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> I think this behavior is intended to allow better LTO between C and C++. Consider this kind of code:
>
> // foo.h
> extern "C" int doThing(bool canThrow);
> // foo.cpp
> int doThing(bool canThrow) {
> ...
> if (hadError) {
> if (canThrow)
2004 Mar 17
1
best methods for strings and structures?
I'm trying to generate an R interface for a library that's commonly used and
I'm currently writing wrapper functions for file i/o and return an object
(list?) that contains the elements of the C structure. For example, reading
a file that contains:
struct CONFIG_RECORD
{
char coeffs_filename[256];
char species_filename[256];
unsigned long
2010 Jun 21
2
[LLVMdev] MC: Object file specific parsing
Hi Daniel,
attached is a patch that pushes most of the object file specific parsing
out of AsmParser and down into MachOAsmParser. This was done as a
cleanup for the ELF work. I know that you're not happy with this
approach, particularly the fact that as we add more object file formats
and assembler dialects, it's going to cause a class explosion. But I was
hoping that we could use this
2017 Feb 05
2
help me understand how nounwind attribute on functions works?
from http://llvm.org/docs/LangRef.html:
nounwind
> This function attribute indicates that the function never raises an
> exception. If the function does raise an exception, its runtime behavior is
> undefined. However, functions marked nounwind may still trap or generate
> asynchronous exceptions. Exception handling schemes that are recognized by
> LLVM to handle asynchronous
2020 Feb 04
3
Reporting source errors from MCCodeEmitter::encodeInstruction() ?
[apologies for this duplicate post: originally sent to lldb-dev by not
paying attention to the address auto-completion]
We have a backend for a target that at present only detects some
assembler errors when emitting instructions (basically because the
platform has configurable properties with dependencies between
instructions and it was easier to check for their interaction late
than try to
2006 Oct 31
1
Some R questions
Hi all,
I am working with some large data sets (1-4 GB) and have some questions
that I hope someone can help me with:
1. Is there a way to turn off garbage collector from within C interface ?
what I am trying to do is suck data from mysql (using my own C
functions) and I see that allocating each column (with about 1-4 million
items) takes between 0.5 and 1 seconds. My
2003 May 02
2
Suppressing Scientific Notation
R gurus,
Every so often(*) someone asks how to suppress scientific notation in
printing, so I thought I'd give it a shot, but I need some help.
The formatting decision is made(**) on line 286 of src/main/format.c :
if (mF <= *m) { /* IFF it needs less space : "F" (Fixpoint) format */
where mF is the number of characters for "normal" printing and *m is the number
2009 Jun 18
1
ScalarLong?
I was surprised to see that there is a ScalarInteger function in
Rinlinedfuns.h, but nothing like ScalarLong.
How can one create an R-integer from a C long?
TIA!
kynn
[[alternative HTML version deleted]]
2014 Jun 25
1
Need help on calling Head from C
Hi ,
I am trying to call head function from C . My doubt is with the parameter
n,how to pass it .
PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE)));
SET_TAG(CDDR(dfm), install("stringsAsFactors")) ;
SEXP res = PROTECT(eval(dfm,R_GlobalEnv));
PROTECT(head=lang3(install("head"),res,ScalarInteger(1)));
head = PROTECT(eval(head,R_GlobalEnv));
I tried
2010 Jan 14
1
how to call a function from C
Hi,
In Rcpp, we now have a "Function" class to encapsulate functions (they
cover all three kinds, but this may change).
To call the function, what we do is generate a call with the function as
the first node and then evaluate the call.
SEXP stats = PROTECT( R_FindNamespace( mkString( "stats") ) );
SEXP rnorm = PROTECT( findVarInFrame( stats, install( "rnorm") ) )
2006 May 23
1
protect
I have a few simple questions about the usage of PROTECT, more
specifically how careful one needs to be. Simple yes/no answers are
fine.
Most of the uses I have seen do protection when memory is allocated.
But what if one just want to assign a value of another function to a
variable. Say eg. that foo is a function that returns a SEXP. Would
the following code be fine?
SEXP bar;
2018 Nov 15
2
STRING_IS_SORTED claims as.character(1:100) is sorted
If I have loaded the C code:
SEXP altrep_STRING_IS_SORTED(SEXP x)
{
return ScalarInteger(STRING_IS_SORTED(x));
}
and defined the function:
issort <- function(x) .Call("altrep_STRING_IS_SORTED",x)
I am seeing the following results in R 3.5.1/Linux:
> issort(LETTERS)
[1] NA
> issort(as.character(1:100)) ## should return NA
[1] 1
>
2010 Dec 02
1
Strange problems with compiling dll
Dear sir\madam!
I'm trying to speed up my R code by writing quite simple dll's in C. But I
faced some problems, and I cannot determine their source.
#include <Rinternals.h>
SEXP mycombin(SEXP N, SEXP k){
int i, *j, *l, c;
j = INTEGER(k);l = INTEGER(N);
c = 1;
if(j[0] > 0 && j[0] < l[0]){
if(j[0] <= l[0] - j[0]){
for(i =