diff liboctave/numeric/lo-specfun.h @ 15696:2fac72a256ce

Add complex erf,erfc,erfcx,erfi,dawson routines from Faddeeva package. * libinterp/corefcn/mappers.cc: Add erfi and dawson mapper functions, and add complex-argument test cases for erf, erfc, erfcx, erfi, and dawson. * libinterp/octave-value/ov-base.cc, libinterp/octave-value/ov-base.h: Add erfi and dawson mapper functions. * libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-flt-complex.cc, libinterp/octave-value/ov-flt-cx-mat.cc, libinterp/octave-value/ov-flt-re-mat.cc, libinterp/octave-value/ov-re-mat.c, libinterp/octave-value/ov-re-sparse.cc, libinterp/octave-value/ov-scalar.cc, libinterp/octave-value/ov.h: Support erf, erfc, erfcx, erfi, and dawson mapper functions for real and complex matrices and scalars. * liboctave/cruft/Faddeeva/Faddeeva.cc, liboctave/cruft/Faddeeva/Faddeeva.hh: liboctave/cruft/Faddeeva/module.mk, liboctave/cruft/Makefile.am: Add Faddeeva package (from http://ab-initio.mit.edu/Faddeeva) to libcruft, to provide the various complex-argument error functions. * liboctave/numeric/lo-specfun.cc, liboctave/numeric/lo-specfun.h: Add complex-argument erf, erfc, erfcx, erfi, and dawson functions to liboctave API. Delete previous real-argument erfcx implementation in favor of Faddeeva::erfcx (which seems to be slightly faster in gcc/x86-64 benchmarks, with similar accuracy). * doc/interpreter/arith.txi: Include erfi and dawson documentation.
author Steven G. Johnson <stevenj@alum.mit.edu>
date Tue, 27 Nov 2012 23:39:54 -0500
parents 648dabbb4c6b
children 578805a293e5
line wrap: on
line diff
--- a/liboctave/numeric/lo-specfun.h	Tue Nov 27 16:38:13 2012 -0800
+++ b/liboctave/numeric/lo-specfun.h	Tue Nov 27 23:39:54 2012 -0500
@@ -56,10 +56,14 @@
 #if !defined (HAVE_ERF)
 extern OCTAVE_API double erf (double);
 #endif
+extern OCTAVE_API Complex erf (const Complex& x);
+extern OCTAVE_API FloatComplex erf (const FloatComplex& x);
 
 #if !defined (HAVE_ERFC)
 extern OCTAVE_API double erfc (double);
 #endif
+extern OCTAVE_API Complex erfc (const Complex& x);
+extern OCTAVE_API FloatComplex erfc (const FloatComplex& x);
 
 #if !defined (HAVE_ACOSHF)
 extern OCTAVE_API float acoshf (float);
@@ -578,8 +582,20 @@
 extern OCTAVE_API double erfcinv (double x);
 extern OCTAVE_API float erfcinv (float x);
 
+extern OCTAVE_API float erfcx (float x);
 extern OCTAVE_API double erfcx (double x);
-extern OCTAVE_API float erfcx (float x);
+extern OCTAVE_API Complex erfcx (const Complex& x);
+extern OCTAVE_API FloatComplex erfcx (const FloatComplex& x);
+
+extern OCTAVE_API float erfi (float x);
+extern OCTAVE_API double erfi (double x);
+extern OCTAVE_API Complex erfi (const Complex& x);
+extern OCTAVE_API FloatComplex erfi (const FloatComplex& x);
+
+extern OCTAVE_API float dawson (float x);
+extern OCTAVE_API double dawson (double x);
+extern OCTAVE_API Complex dawson (const Complex& x);
+extern OCTAVE_API FloatComplex dawson (const FloatComplex& x);
 
 extern OCTAVE_API double betaincinv (double x, double a, double b);
 extern OCTAVE_API Array<double> betaincinv (double x, double a, const Array<double>& b);