ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
math_erf_complex.h
Go to the documentation of this file.
1#ifndef MATH_ERF_COMPLEX_H
2#define MATH_ERF_COMPLEX_H
3
4#include <complex>
5#include <vector>
6
7namespace ModuleBase
8{
9
11{
12 public:
13 ErrorFunc();
14 ~ErrorFunc();
15
23 // compute w(z) = exp(-z^2) erfc(-iz) [ Faddeeva / scaled complex error func ]
24 static std::complex<double> scaled_w(std::complex<double> z, double relerr);
25 static double scaled_w_im(double x); // special-case code for Im[w(x)] of real x
26
27 // compute erfcx(z) = exp(z^2) erfc(z)
28 static std::complex<double> erfcx(std::complex<double> z, double relerr = 0);
29 static double erfcx(double x); // special case for real x
30
31 // compute erf(z), the error function of complex arguments
32 static std::complex<double> erf(std::complex<double> z, double relerr = 0);
33
34 // compute erfi(z) = -i erf(iz), the imaginary error function
35 static std::complex<double> erfi(std::complex<double> z, double relerr = 0);
36 static double erfi(double x); // special case for real x
37
38 // compute erfc(z) = 1 - erf(z), the complementary error function
39 static std::complex<double> erfc(std::complex<double> z, double relerr = 0);
40
41 private:
42 static double w_im_y100(double y100, double x);
43 static inline double sinc(double x, double sinx)
44 {
45 return fabs(x) < 1e-4 ? 1 - (0.1666666666666666666667) * x * x : sinx / x;
46 }
47 static inline double copysign(double x, double y)
48 {
49 return x < 0 != y < 0 ? -x : x;
50 }
51 static const std::vector<double> expa2n2;
52};
53} // namespace ModuleBase
54
55#endif // MATH_ERF_H
Definition math_erf_complex.h:11
~ErrorFunc()
Definition math_erf_complex.cpp:16
static double scaled_w_im(double x)
Definition math_erf_complex.cpp:271
static const std::vector< double > expa2n2
Definition math_erf_complex.h:51
static std::complex< double > scaled_w(std::complex< double > z, double relerr)
A class of the error function of complex arguments based on Faddeeva algorithm. More information plea...
Definition math_erf_complex.cpp:20
static std::complex< double > erf(std::complex< double > z, double relerr=0)
Definition math_erf_complex.cpp:301
static double sinc(double x, double sinx)
Definition math_erf_complex.h:43
static double copysign(double x, double y)
Definition math_erf_complex.h:47
static std::complex< double > erfcx(std::complex< double > z, double relerr=0)
Definition math_erf_complex.cpp:408
static std::complex< double > erfc(std::complex< double > z, double relerr=0)
Definition math_erf_complex.cpp:414
static std::complex< double > erfi(std::complex< double > z, double relerr=0)
Definition math_erf_complex.cpp:397
ErrorFunc()
Definition math_erf_complex.cpp:13
static double w_im_y100(double y100, double x)
Definition math_erf_complex.cpp:444
Definition array_pool.h:6