26std::complex<double>
complexErf(std::complex<double> z,
long *flag) {
32 wofz(&xi, &yi, &u, &v, &lflag);
34 return std::complex<double>(u, v);
43std::complex<double>
cexpi(
double p) {
44 std::complex<double> a;
45 a = cos(p) + std::complex<double>(0, 1) * sin(p);
56std::complex<double>
cipowr(std::complex<double> a,
int n) {
58 std::complex<double> p(1, 0);
61 for (i = 0; i < n; i++)
82 double *r0,
double *i0,
84 double r2,
double i2) {
87 tempr = r1 * r2 - i1 * i2;
88 *i0 = r1 * i2 + i1 * r2;
106 double *r0,
double *i0,
107 double r1,
double i1,
108 double r2,
double i2,
112 if ((denom = sqr(r2) + sqr(i2)) < threshold)
115 tempr = (r1 * r2 - i1 * i2) / denom;
116 *i0 = (r1 * i2 + i1 * r2) / denom;
std::complex< double > complexErf(std::complex< double > z, long *flag)
Computes the complex error function of a given complex number.
std::complex< double > cipowr(std::complex< double > a, int n)
Raises a complex number to an integer power.
void complex_divide(double *r0, double *i0, double r1, double i1, double r2, double i2, double threshold)
Divides two complex numbers.
void complex_multiply(double *r0, double *i0, double r1, double i1, double r2, double i2)
Multiplies two complex numbers.
std::complex< double > cexpi(double p)
Computes the complex exponential of an imaginary number.
int wofz(doublereal *xi, doublereal *yi, doublereal *u, doublereal *v, logical *flag__)
Computes the complex error function for a given complex number .