Re: [Rd] simple C function segfaults

2006-02-21 Thread Prof Brian D Ripley
On Tue, 21 Feb 2006, Simon Urbanek wrote: > > On Feb 21, 2006, at 2:48 PM, Bernd Kriegstein wrote: > >> Thank you very much for the answer. As a general principle, when >> and why should I register the counters? > > "register int i" is merely an optimization, you can safely use "int > i" instead.

Re: [Rd] simple C function segfaults

2006-02-21 Thread Simon Urbanek
On Feb 21, 2006, at 2:48 PM, Bernd Kriegstein wrote: > Thank you very much for the answer. As a general principle, when > and why should I register the counters? "register int i" is merely an optimization, you can safely use "int i" instead. The "register" keyword only tells the compiler to

Re: [Rd] simple C function segfaults

2006-02-21 Thread Bernd Kriegstein
Thank you very much for the answer. As a general principle, when and why should I register the counters? Should I do the same in matrices or other parameters that I pass and alter in the main body of the C function? Thanks again, - b. --- Paul Roebuck <[EMAIL PROTECTED]> schrieb: > On Tue, 21 F

Re: [Rd] profiling C code

2006-02-21 Thread Simon Urbanek
On Feb 20, 2006, at 7:18 PM, Ross Boylan wrote: > Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code

Re: [Rd] profiling C code

2006-02-21 Thread Prof Brian Ripley
Some more information. 1) Whether gprof works is system-specific. Solaris says in man gprof 64-bit profiling 64-bit profiling may be used freely with dynamically linked executables, and profiling information is collected for the shared objects if the objects are compiled

Re: [Rd] profiling C code

2006-02-21 Thread Thomas Lumley
On Mon, 20 Feb 2006, Ross Boylan wrote: > Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code I've written

Re: [Rd] invalid graphics state using dev.print (fwd)

2006-02-21 Thread Prof Brian Ripley
On Tue, 21 Feb 2006, Hin-Tak Leung wrote: > Prof Brian Ripley wrote: >> On Mon, 20 Feb 2006, Prof Brian Ripley wrote: >> >>> On Mon, 20 Feb 2006, Paul Murrell wrote: > > >> x11() > >> plot(rnorm(10)) > >> dev.print(png) > >>> I don't think there is a way to do that unambiguously

Re: [Rd] invalid graphics state using dev.print (fwd)

2006-02-21 Thread Hin-Tak Leung
Prof Brian Ripley wrote: > On Mon, 20 Feb 2006, Prof Brian Ripley wrote: > >>On Mon, 20 Feb 2006, Paul Murrell wrote: >> x11() >> plot(rnorm(10)) >> dev.print(png) >>I don't think there is a way to do that unambiguously (there is no >>standard way to do the conversion), and in