search for: s_alloc

Displaying 20 results from an estimated 31 matches for "s_alloc".

Did you mean: r_alloc
1997 May 20
1
R-alpha: S_alloc
Does anyone know what exactly S_alloc() does? (Yes, it's porting time again ...) Thanks, -k =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the &quot...
1997 Jul 28
0
R-alpha: R 0.50.a1 S_alloc BUG, priority = URGENT
The current version of S_alloc in src/main/memory.c is char *S_alloc(long nelem, int eltsize) { unsigned int i, size; char *p = R_alloc(nelem, eltsize); for(i=0 ; i<size; i++) p[i] = 0; return p; } which segfaults because `size' is not initialized. I am not what the right fix is, adding size = nelem * eltsize;...
2002 Jun 13
3
[R] help debugging segfaults
Hi all, Thanks to Prof. Ripley, Prof. Gentleman, and Simon Wood (did I miss anyone?). The problem seemed to have gone away. Everyone suggested using some malloc debugger (such as Electric Fence). All I did was following half of what BDR suggested below, i.e., changing all the S_alloc() calls to Calloc() and Free(). I didn't get to try efence, and the problem seems to have disappeared! As I read it from the R-exts manual, the difference between S_alloc and Calloc is that S_alloc takes memory from the heap, whereas Calloc takes memory addtional to the heap. So can anyone e...
1998 Jan 21
2
alloc
I am trying to get our database interface (PADI) working with R. The code does some memory allocation and for Splus there is an ifdef which controls whether malloc or S_alloc is called. I did nm R.binary | grep alloc to see if this was supported and I find there are some choices: [2490] | 446036| 272|FUNC |GLOB |0 |7 |R_alloc [806] | 693956| 312|FUNC |LOCL |0 |7 |ReallocString [807] | 693220| 736|FUNC |LOCL |0 |7 |ReallocVec...
2009 Jul 20
3
S_alloc or Calloc for return value
...by the user", and it's clear that this is to be done within the C function in question. Summary question: how can I allocate memory withing a C function, making it available to an R function that calls the C function? Thanks. Dan. -- View this message in context: http://www.nabble.com/S_alloc-or-Calloc-for-return-value-tp24579062p24579062.html Sent from the R help mailing list archive at Nabble.com.
1999 Dec 23
1
rpart on Alpha under OSF
...ee.o gini.o graycode.o insert_split.o make_cp_list.o make_cp_table.o mysort.o nodesplit.o partition.o poisson.o poissonpred.o pred_rpart.o rpart.o rpcountup.o rplabel.o rpmatrix.o rundown.o rundown2.o s_to_rp.o s_xpred.o surrogate.o xval.o -lUfor -lfor -lFutil -lm -lots -lm ld: Warning: Unresolved: S_alloc What is S_alloc? Do I have to install the full source for R in order to compile a package? I do not have root rights on this machine, which is why I went for the compiled distribution. Compiling the same package on my Linux Intel machine works all right, so I guess the problem is I am missing s...
2004 Mar 30
5
optim-Bug (PR#6720)
Full_Name: Dr. Hans A. Kestler Version: 1.8.1. OS: Linux, Win, Mac OSX Submission from: (NULL) (134.60.73.116) The code below produces after a different number of iterations i the following error: Error in optim(par = rep(0.5, length(edges)), loglik, method = "L-BFGS-B", : non-finite value supplied by optim This was reproducible on different machines (Mac G4 OSX, AMD Opteron
2008 Jan 19
1
R_alloc segfaults
...call lbfgsb from my stand-alone C program, its R_alloc call is evaluated with these arguments > R_alloc (nelem=1, eltsize=-1073870176) at memory.c:1649 and I get a segfault again. When I modify the original optim.c to use malloc instead of R_alloc, I get the segfault a little later when it calls S_alloc. So I'd like to fix the R_alloc/S_alloc problem, rather than modifying the whole optim.c code. Any hints how I can fix the R_alloc calls and avoid the segmentation faults? Thanks! Markus
2002 Mar 01
1
fft
Hi, I have problems when calling fft_factor and fft_work directly in my C-code. Martin Maechler already told me that I should not do this -- anyway, the code works fine if the length of the vector is a multiple of 2,3,5. If the length of the vector has different form I get, in some cases, a segmentation fault when work and iwork are freed (I use C's malloc to allocate memory for work and
2002 Jun 12
3
help debugging segfaults
...here to look for the problem. The randomForest package mainly consists of two things: rf.c contains rf(), a C wrapper function that calls the Fortran subroutines in rfsub.f that do most of the work (slightly altered from Breiman's original code). All memory allocations are done in rf.c, using S_alloc(). When I run random forest with the data and setting as mentioned above, it was able to finish growing the 7000 trees, but segfault when returning from rf() to R. GDB gave the following (gdb prompts removed): do_dotCode (call=0x873aff4, op=0x8a5f620, args=0x8a5d010, env=0x86fd0a4) at dotcod...
2002 Jun 12
3
help debugging segfaults
...here to look for the problem. The randomForest package mainly consists of two things: rf.c contains rf(), a C wrapper function that calls the Fortran subroutines in rfsub.f that do most of the work (slightly altered from Breiman's original code). All memory allocations are done in rf.c, using S_alloc(). When I run random forest with the data and setting as mentioned above, it was able to finish growing the 7000 trees, but segfault when returning from rf() to R. GDB gave the following (gdb prompts removed): do_dotCode (call=0x873aff4, op=0x8a5f620, args=0x8a5d010, env=0x86fd0a4) at dotcod...
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 where arrays are accessed. Everything ran fine. (...
1999 May 27
3
No subject
...out some documentation, but closer consideration of some R documentation has led me to worry that my code a) may not achieve certain standards of R and C programming and b) may not work on all systems. (I'm using 0.64.1 on a UNIX system) My worries are a) That I've used calloc rather than S_alloc throughout. b) That I've used the following technique: I've calls to different C programs held together in a single file which looks like: GLM g; /* information about the model */ OUTPUT o; /* information about the output * f1(g){ ....... } f2(g,o) { .........
1999 Jan 02
3
.C
...drastically (and slow things down). 2. Is there support for "pointer to pointer" arguments to .C? NetCDF files contain the data attributes, which aren't known until the files are read. Our S+ code defines a dummy variable for the data dimensions, which are redefined (calling "S_alloc") and set within the C code once they are known. The appended example works in S+ using the pointers= argument in .C. Is there a way to do this in R? Thanks...Steve Oncley oncley@ucar.edu C-code: void inquire_varid( int *ncid_p, /* NetCDF file id. File is left open */ int *v...
2007 Jun 06
3
C function with unknown output length
Hi all, Could anyone point me to one or more examples in the R sources of a C function that is called without knowing in advance what will be the length (say) of the output vector? To make myself clearer, we have a C function that computes probabilities until their sum gets "close enough" to 1. Hence, the number of probabilities is not known in advance. I would like to have an
1998 May 08
1
No subject
Hi, I just downloaded R for windows and subscribed to this list. I would like to know if it is possible to install an add-on package (e.g. spatial) in the Win95 version (0.61.1). Thank you, Pierre ======================================= Pierre Vernier Research Associate / GIS Coordinator Centre for Applied Conservation Biology Forest Sciences, UBC Phone 1: (604) 822-8288 Phone 2: (604)
1999 Jun 07
0
R/C programming and documentation---thanks and summary
Thanks to everyone who helped with my query---Professors Riply, Bates, Lumley, and Tim Keitt. I said <snip> > My worries are > > a) That I've used calloc rather than S_alloc throughout. Professors Bates and Ripley both pointed out that calloc should be replaced by Calloc and free by Free, which, I'll do. ---- I said: > b) That I've used the following technique: I've > calls to different C programs held together in a single > file which...
2003 Oct 07
0
C dynamic library error on Solaris 7
...eople/biostat3/sinnwell/Rdir/library") : .First.lib failed When I remove this one C file from the package, though remaining R-functions depend on it, the library loads beautifully. We've followed guidelines in Venebles and Ripley's S Programming to handle Calloc, Free, and S_alloc in all three files. I think there is a possibility the problem is there. I looked at R-help archive emails with similar error messages, and those looked like fortran compiler version issues. Am I also dealing with a compiler issue? FYI: We have the whole haplo.stats package working in S....
2006 Jul 21
0
(no subject)
...rtran, and Fortran often does zero it seems a likely symptom, but it does mean that a variable is being used uninitialized somewhere in the code (converted to C). It would be better to leave vect alone and to zero the workspace with a memset call in lbfgsb. (Incidentally, I don't know why S_alloc does not use memset -- we do require standard C and use in seeral other places.) -- Brian D. Ripley, could be relevant to my case. The question is: How can I zero the workspace with a memset call in lbfgsb? I have read the Rhelp for windows and tried to zero the workspace from "RGui.ex...
1999 Jan 22
1
two questions
A non-text attachment was scrubbed... Name: not available Type: text Size: 722 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-help/attachments/19990122/cea14ffd/attachment.pl