Robin Hankin
2005-Jul-01 13:41 UTC
[Rd] C code in packages with complex arguments/returned value
Hi one of my packages has a severe bottleneck at a particular function and I suspect that replacing the R code with C code would speed it up. The function takes complex arguments and returns a complex value. I would like to follow Best Practice here. None of the C code in my packages includes the ability to handle complex numbers (this is done by R). Does anyone know of a package that includes C code which manipulates and returns complex arguments that I could take a look at? Yes, there is src/main/complex.c, but I would like to see how complex arithmetic is done in a package (or how it should be done). -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
Prof Brian Ripley
2005-Jul-01 13:58 UTC
[Rd] C code in packages with complex arguments/returned value
Search for uses of Rcomplex in package source code. The only packages on CRAN which use it are ifs and rimage. On Fri, 1 Jul 2005, Robin Hankin wrote:> Hi > > one of my packages has a severe bottleneck at a particular function > and I > suspect that replacing the R code with C code would speed it up. > The function takes complex arguments and returns a complex value. > > I would like to follow Best Practice here. None of the C code in my > packages includes the ability to handle complex numbers (this is done > by R). > > Does anyone know of a package that includes C code which manipulates > and returns complex arguments that I could take a look at? > > Yes, there is src/main/complex.c, but I would like to see how complex > arithmetic is > done in a package (or how it should be done). > > -- > Robin Hankin > Uncertainty Analyst > National Oceanography Centre, Southampton > European Way, Southampton SO14 3ZH, UK > tel 023-8059-7743 > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595