similar to: Return dynamic array from C to R

Displaying 20 results from an estimated 60000 matches similar to: "Return dynamic array from C to R"

2011 Mar 24
2
Using C code in R
Hi, I am new to R and I want to know how to use C code which contains two functions one called inside another.I know that how to use C code in R if it has only one function but dont know how to do it in above case. I want to use the same in R .My C code is as follows. //#include <R.h> void sayHello(); void g(); void sayhello() { Rprintf("Hello world %d\n",global); } void
2011 Jun 18
1
Pass Vector from R to C
Hi , I have a function which passes a vector from R to C. However the size of the vector is decided inside the c program. But as I have to pass the size while calling the function from R lot of my space is getting wasted. Is there any other alternative? I call c function as :
2009 Apr 03
1
Hello! I got error in C - R
Hello, My name is Ick Hoon Jin and I am Ph. D. student in Texas A & M Univ.. When I run the C embedded in R in the Linux system, I confront the following error after 6,000 iteration. By googling I found this error is from the problem in C. *** caught segfault *** address (nil), cause 'memory not mapped' My C code is following:
2001 Jan 05
1
segfault when calling C code
Hi, all. I've got some C code that I've used successfully, and fairly extensively, in R-1.1.1, which is suddenly causing segmentation faults in R-1.2.0. The original code used calloc (just plain calloc) with a free at the end, but I've tried replacing the calloc with R_alloc (based on the Writing R extensions documentation, which I'm not sure I've understood properly), and
2006 Apr 13
2
Calloc : syntax error
Hi, I have issue with Calloc : at the compilation step, gcc tells "error : syntax error before ')' token". When I use the classical C calloc... free, everything's fine. Here's the part of code : a = (double*) Calloc(*n,sizeof(double)); when i remove this line or replace it with the calloc, it's ok Hint : In the header file R.h, there's a line : /* for PROBLEM
2002 Jan 14
1
Problems with .C - [Ff]ree()?
I've just pulled my R installations up to 1.4.0, and am having trouble with some of my dyn.load'd C code: R frequently segfaults after .C calls into the (newly rebuilt) libraries. It hasn't happened with any previous versions of R I've used. I do seem to be able to make things behave by removing calls to free(). Changing everything to Calloc() and Free(), didn't help,
2011 Mar 28
1
Points on Map
Hi, I am new to R and I want to plot points on the Map of New York . I also want to divide map of New York into small grids(not fixed) .I want that these point should be plotted from a file.How can I do it?Any help would be greatly appreciated. Thanks Jaimin [[alternative HTML version deleted]]
2011 Apr 05
1
Grid on Map
I am new to R.I want to draw grid from a csv file which contains latitude minimum ,latitude maximum ,longitude minimum ,longitude maximum.The grid should be divided into exactly 4 quadrants. The map is of NY state of USA. I want to know how can I do it. Help would be appreciated. Thanks Jaimin [[alternative HTML version deleted]]
2009 Jun 12
1
Can't get F77_CALL(dgemm) to work [SEC=UNCLASSIFIED]
Hi I am new to writing C code and am trying to write an R extension in C. I have hit a wall with F77_CALL(dgemm) in that it produces wrong results. The code below is a simplified example that multiplies the matrices Ab and Bm to give Cm. The results below show clearly that Cm is wrong. Am= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Bm= 1 1 1 1 1
2003 Dec 05
3
.C() memory allocation
I would like to retrieve a vector of integers from a call to .C(), but I don't know its length in advance. How do I do this without making an ugly safe guess? My vector is called "sequences". I am passing the argument sequences = integer(0) in the call to .C(), then declaring the corresponding argument as int *sequences in my C code. I tried R_alloc()ing the storage in C and
2001 Mar 28
1
Help: Using R from C
Hi folks: I am just beginning to try and use R from my own C programs. Platform is Windows2000, compiler Visual C++ 6.0. I built the import library R.lib from R.dll using the VC LIB.exe program. Here is a simple code I am trying to compile and run (no C++, VC++ is instructed to treat it strictly as C): #include "R.h" #include "Rinternals.h" int main(void) { int i; char
2006 Jan 10
3
Issue with c++ .C call
I am still having some difficulties with connecting R to a C++ function. I am able to call the function as expected after compiling the shared library and such. However, the call to the function is via .C; parameters from the .C call are not being passed correctly to the function. As an example, I have attached a GDB run of the code. I set a breakpoint on entry to the function I am calling
2015 Jun 18
1
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
Hi, On Thursday 18 June 2015 05:14:46 Chen, Hanxiao wrote: > > -----Original Message----- > > From: libguestfs-bounces@redhat.com [mailto:libguestfs-bounces@redhat.com] On > > Behalf Of Pino Toscano > > Sent: Wednesday, June 17, 2015 10:44 PM > > To: libguestfs@redhat.com > > Subject: Re: [Libguestfs] [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return
2002 Jun 18
1
can't find array overruns (was: help debugging segfaults)
Dear R-devel, Last week I got several responses to my question about debugging segfaults in my code (original post below). After I changed the S_alloc() calls to Calloc()/Free(), the symptom was gone, but I was told to keep looking. So I did: o Switched to Calloc/Free. Electric Fence did not find any problem. o Put assert(index < bound); assert(index >=0); everywhere in the C routine
2018 Oct 26
1
Rmpfr: build vector sequentially -- c(.) not working
I've been asked in private, but am answering in public so others can comment / or find this answer in the future after a web search. This is about the package 'Rmpfr' (R interface to MPFR, the GNU C library for arbitrary precise numbers). > How can you build a vector of mpfr numbers sequentially? > Typically I would do something like the following (and try to > replace the
2008 Dec 16
0
[LLVMdev] Another compiler shootout
On Tuesday 16 December 2008 01:03:36 Evan Cheng wrote: > FYI. http://leonardo-m.livejournal.com/73732.html > > If anyone is motivated, please file bugs for the losing cases. Also, > it might make sense to incorporate the tests into our nightly tester > test suite. FWIW, I just ported my ray tracer benchmark to C and found that llvm-gcc gives much worse performance than gcc on x86
2010 Apr 20
2
QCA3 segfault
Hi I have just dwonloaded QCA3 onto this machine (ubuntu, karmic, amd64) and a mac. The examples run fine on teh mac, but crashed R on ubuntu. Any help much apprecia\ted. Thanks Richard ------------------------------------------------------------------------------ Terminal log: > conditions <- >
2015 Aug 27
3
[Mesa-dev] gallium state tracker calls calloc for 0 sizes arrays ?
On Thu, Aug 27, 2015 at 1:59 PM, Alex Deucher <alexdeucher at gmail.com> wrote: > On Thu, Aug 27, 2015 at 1:55 PM, Hans de Goede <hdegoede at redhat.com> wrote: >> Hi, >> >> On 27-08-15 15:46, Marek Olšák wrote: >>> >>> On Thu, Aug 27, 2015 at 3:09 PM, Hans de Goede <hdegoede at redhat.com> >>> wrote: >>>>
2011 Mar 24
0
[LLVMdev] mblaze backend: unreachable executed
Okay, I've done a lot more testing and I now have a .bc file that compiles for x86, sparc, mips but refuses to compile for the mblaze and powerPC backends because of the calling convention. Is there anyone that would know how to fix the microblaze calling convention or point me in the right direction on how to fix it? The lines in the .bc that I believe to be causing the problem are the
2009 Jul 20
3
S_alloc or Calloc for return value
I am trying to write a C function to create a vector of integers that can be used by the R calling function. I do not know the size of the vector in the R calling function. (Well, actually, I have an upper limit on the size, but that is so large that R cannot allocate it. What I'm doing in the function is to do a sieving procedure, and the result will be small enough to fit into my