16 #ifndef dealii__numbers_h 17 #define dealii__numbers_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/types.h> 27 DEAL_II_NAMESPACE_OPEN
33 DEAL_II_NAMESPACE_CLOSE
37 template <
typename Number> DEAL_II_ALWAYS_INLINE ::VectorizedArray<Number>
38 sqrt(const ::VectorizedArray<Number> &);
39 template <
typename Number> DEAL_II_ALWAYS_INLINE ::VectorizedArray<Number>
40 abs(const ::VectorizedArray<Number> &);
41 template <
typename Number> DEAL_II_ALWAYS_INLINE ::VectorizedArray<Number>
42 max(const ::VectorizedArray<Number> &, const ::VectorizedArray<Number> &);
43 template <
typename Number> DEAL_II_ALWAYS_INLINE ::VectorizedArray<Number>
44 min (const ::VectorizedArray<Number> &, const ::VectorizedArray<Number> &);
47 DEAL_II_NAMESPACE_OPEN
69 static const double E = 2.7182818284590452354;
74 static const double LOG2E = 1.4426950408889634074;
79 static const double LOG10E = 0.43429448190325182765;
84 static const double LN2 = 0.69314718055994530942;
89 static const double LN10 = 2.30258509299404568402;
94 static const double PI = 3.14159265358979323846;
99 static const double PI_2 = 1.57079632679489661923;
104 static const double PI_4 = 0.78539816339744830962;
109 static const double SQRT2 = 1.41421356237309504880;
114 static const double SQRT1_2 = 0.70710678118654752440;
126 bool is_nan (
const double x);
143 bool is_finite (
const std::complex<double> &x);
149 bool is_finite (
const std::complex<float> &x);
159 bool is_finite (
const std::complex<long double> &x);
171 template <
typename number>
195 const number &
conjugate (
const number &x);
219 template <
typename number>
241 std::complex<number>
conjugate (
const std::complex<number> &x);
264 #ifdef DEAL_II_HAVE_STD_ISNAN 265 return std::isnan(x);
266 #elif defined(DEAL_II_HAVE_ISNAN) 268 #elif defined(DEAL_II_HAVE_UNDERSCORE_ISNAN) 277 #ifdef DEAL_II_HAVE_ISFINITE 278 return !
is_nan(x) && std::isfinite (x);
283 return ((x >= -std::numeric_limits<double>::max())
285 (x <= std::numeric_limits<double>::max()));
313 inline bool is_finite (
const std::complex<long double> &x)
322 template <
typename number>
331 template <
typename number>
340 template <
typename number>
349 template <
typename number>
358 template <
typename number>
367 template <
typename number>
371 return std::norm (x);
388 template <
typename T>
391 static T value (
const T &t)
397 template <
typename T>
400 static std::complex<T> value (
const T &t)
402 return std::complex<T>(t);
407 DEAL_II_NAMESPACE_CLOSE
static const number & conjugate(const number &x)
static const double SQRT2
static real_type abs(const number &x)
bool is_finite(const double x)
static real_type abs_square(const number &x)
static const bool is_complex
bool is_nan(const double x)
T min(const T &t, const MPI_Comm &mpi_communicator)
static const double LOG2E
static const double SQRT1_2
T max(const T &t, const MPI_Comm &mpi_communicator)
static const double LOG10E