Hi Steven, Some comments below with regards to Jordi's observations on integration.
On 11/20/2012 03:33 PM, Jordi Gutiérrez Hermoso wrote: > On 4 November 2012 00:34, Steven G. Johnson<stev...@alum.mit.edu> wrote: >> There is an updated version of my package >> (http://ab-initio.mit.edu/Faddeeva) which computes not only the Faddeeva >> function (the scaled complex error function) but also the ordinary erf >> and erfc functions of complex arguments, as well as the erfcx and erfi >> variants and the Dawson function (a scaled erfi). >> >> This should make it relatively painless to drop it in as a replacement >> for the Octave erf and erfc functions in order to support complex arguments. > > I'm still not sure what to do with this code... It sounds useful, > sure, but you didn't write it for Octave except for a small wrapper. > Since you're trying to overwrite Octave functions, it should go in > Octave core but you also want to provide a bunch of other special > functions, so those should go in the specfun package in OF. How much of this is the Faddeeva function and how much of it is supporting code? One concern I would have, just looking at the code for a few minutes, is all the repetitive routines for square root, sinc, etc. I would think the preference should be to utilize such algorithms from Octave's core or utilize the library that Octave is using. That way things remain consistent. The issue for integration is then what hunks to integrate and how. The package can certainly remain in the current form. For reference, the current erf and erfc appear to come from the standard math library: # gl_COMMON_DOUBLE_MATHFUNC(FUNC) # ------------------------------- # tests whether the function FUNC is available in libc or libm. # It sets FUNC_LIBM to empty or "-lm" accordingly. # FUNC must be one of the following functions, that are present on all systems # and provided by libm on all systems except Mac OS X, BeOS, Haiku: # acos asin atan atan2 cbrt cos cosh erf erfc exp fmod hypot j0 j1 jn lgamma # log log10 log1p pow remainder sin sinh sqrt tan tanh y0 y1 yn > I'm also not sure how committed you are to maintaining this code for > Octave. If this is a one-time code dump and it's up to us to maintain > this code in the future, I'm less inclined to accept it into Octave > core, since it's a relatively rare request. I have never heard of our > users clamouring for the Faddeeva function or its relatives. Certainly error function and complimentary error function find general use, but Faddeeva function seems like something particular to wave theory or Fourier analysis. Whether that belongs in the special functions category or a wave-theory (or similar) package, I don't know. This has an MIT license, correct? Is that compatible with GPL? From my brief browsing of the code, it does seem to be original and reference up-to-date papers on the algorithm and its limitations. It seems to me the first question is whether to replace erf/erfc in the core source with something that handles complex inputs. I'm not sure Faddeeva function on its own warrants core code. But there might be a better way to put Faddeeva function in a package, script code being one possibility if that turns out to not be too slow. Dan ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev