Header file for collection of miscellaneous special functions for nanomagnFMM. More...
#include <cstdlib>#include <complex>Go to the source code of this file.
Defines | |
| #define | isnan(x) |
| #define | isinf(x) |
| #define | INFINITYCHECK |
| #define | NANCHECK |
| #define | SIGNCHECK |
Typedefs | |
| typedef std::complex< double > | dcmplx |
| Double complex type. | |
Functions | |
| dcmplx | ibeta (dcmplx z, dcmplx a, dcmplx b) |
| Incomplete beta function of complex argument and complex parameters. | |
| dcmplx | lngamma (dcmplx z) |
| Logarithm of Gamma function. | |
| int | GaussJacobiRule (double *x, double *w, const int Q, const double alpha, const double beta) |
| abscissas and weights of Gauss-Jacobi quadrature rule. | |
| bool | tol_eq (double a, double b) |
| Tolerant comparison for equality of two double numbers. | |
| bool | tol_eq (dcmplx a, dcmplx b) |
| Tolerant comparison for equality of two complex double numbers. | |
| double | HeavisideTheta (double x) |
Left-handed theta function. It is equal to if and if . | |
| int | sign (double x) |
| bool | IsInfinite (float A) |
| bool | IsNan (float A) |
| int | Sign (float A) |
| bool | AlmostEqualUlps (float A, float B, int maxUlps) |
Header file for collection of miscellaneous special functions for nanomagnFMM.
| #define isinf | ( | x | ) |
(sizeof (x) == sizeof (long double) ? isinf_ld (x) \ : sizeof (x) == sizeof (double) ? isinf_d (x) \ : isinf_f (x))
| #define isnan | ( | x | ) |
(sizeof (x) == sizeof (long double) ? isnan_ld (x) \ : sizeof (x) == sizeof (double) ? isnan_d (x) \ : isnan_f (x))
| int GaussJacobiRule | ( | double * | x, | |
| double * | w, | |||
| const int | Q, | |||
| const double | alpha, | |||
| const double | beta | |||
| ) |
abscissas and weights of Gauss-Jacobi quadrature rule.
The rule can be used to approximately represent the integral
in the form
For a given
the rule integrates polynomials up to the order
exactly.
| x | array of the length Q to hold the resulting abscissas (output). | |
| w | array of the length Q to hold the resulting weights (output). | |
| Q | order of the rule (of the corresponding Jacobi polynomial. | |
| alpha | weight parameter (at the right of the interval) must be >-1. | |
| beta | weight parameter (at the left of the interval) must be >-1. |
References jac_weights_gj(), and jac_zeros_gj().
| double HeavisideTheta | ( | double | x | ) | [inline] |
Left-handed theta function. It is equal to
if
and
if
.
| x | argument. |
Incomplete beta function of complex argument and complex parameters.
The incomplete beta function is defined as
When parameters are real and
the Beta function is real.
| z | argument of the Beta function (can be complex) | |
| a | parameter of Beta function | |
| b | parameter of Beta function |
Logarithm of Gamma function.
It is calculated by GSL with phase (complex part) modified to match Mathematica definition.
That is lngamma(z) is analytic throughout the complex plane with a single branch cut discontinuity along the negative real axis (
has more branch cuts).
| z | argument. |
. Tolerant comparison for equality of two complex double numbers.
| a | number to compare | |
| b | another number to compare |
References EPS.
| bool tol_eq | ( | double | a, | |
| double | b | |||
| ) |
Tolerant comparison for equality of two double numbers.
Compares numbers for equality with tolerance tol=100 * machine_epsilon. Formally, the numbers are equal if the absolute value of a-b is not greater than t, multiplied by the max(|a|,|b|).
| a | number to compare | |
| b | another number to compare |
References EPS.
1.6.3