numbers Namespace Reference

Classes

struct  NumberTraits
struct  NumberTraits< std::complex< number > >

Functions

bool is_finite (const double x)
bool is_finite (const std::complex< double > x)
bool is_finite (const std::complex< float > x)
bool is_finite (const std::complex< long double > x)

Variables

static const unsigned int invalid_unsigned_int = static_cast<unsigned int> (-1)
static const double E = 2.7182818284590452354
static const double LOG2E = 1.4426950408889634074
static const double LOG10E = 0.43429448190325182765
static const double LN2 = 0.69314718055994530942
static const double LN10 = 2.30258509299404568402
static const double PI = 3.14159265358979323846
static const double PI_2 = 1.57079632679489661923
static const double PI_4 = 0.78539816339744830962
static const double SQRT2 = 1.41421356237309504880
static const double SQRT1_2 = 0.70710678118654752440

Detailed Description

Namespace for the declaration of universal constants. Since the availability in math.h is not always guaranteed, we put them here. Since this file is included by base/config.h, they are available to the whole library.

The constants defined here are a subset of the M_XXX constants sometimes declared in the system include file math.h, but without the prefix M_.

In addition to that, we declare invalid_unsigned_int to be the largest unsigned integer representable; this value is widely used in the library as a marker for an invalid index, an invalid size of an array, and similar purposes.


Function Documentation

bool numbers::is_finite ( const double  x  ) 

Return true if the given value is a finite floating point number, i.e. is neither plus or minus infinity nor NaN (not a number).

Note that the argument type of this function is double. In other words, if you give a very large number of type long double, this function may return false even if the number is finite with respect to type long double.

Referenced by Vector< Number >::add(), SparseMatrixEZ< number >::add(), BlockSparseMatrixEZ< Number >::add(), Vector< Number >::operator*=(), Vector< Number >::operator/=(), Vector< Number >::operator=(), Vector< Number >::sadd(), Vector< Number >::scale(), SparseMatrixEZ< number >::set(), and BlockSparseMatrixEZ< Number >::set().

bool numbers::is_finite ( const std::complex< double x  ) 

Return true if real and imaginary parts of the given complex number are finite.

bool numbers::is_finite ( const std::complex< float >  x  ) 

Return true if real and imaginary parts of the given complex number are finite.

bool numbers::is_finite ( const std::complex< long double x  ) 

Return true if real and imaginary parts of the given complex number are finite.

Again may not work correctly if real or imaginary parts are very large numbers that are infinite in terms of double, but finite with respect to long double.


Variable Documentation

const unsigned int numbers::invalid_unsigned_int = static_cast<unsigned int> (-1) [static]

Representation of the largest number that can be put into an unsigned integer. This value is widely used throughout the library as a marker for an invalid unsigned integer value, such as an invalid array index, an invalid array size, and the like.

Referenced by FiniteElement< dim, spacedim >::block_to_base_index(), internal::hp::DoFObjects< dim >::fe_index_is_active(), internal::hp::DoFObjects< dim >::get_dof_index(), internal::hp::DoFObjects< dim >::n_active_fe_indices(), internal::hp::DoFObjects< dim >::nth_active_fe_index(), MGTransferSelect< number >::select(), and internal::hp::DoFObjects< dim >::set_dof_index().

const double numbers::E = 2.7182818284590452354 [static]

e

const double numbers::LOG2E = 1.4426950408889634074 [static]

log_2 e

const double numbers::LOG10E = 0.43429448190325182765 [static]

log_10 e

const double numbers::LN2 = 0.69314718055994530942 [static]

log_e 2

const double numbers::LN10 = 2.30258509299404568402 [static]

log_e 10

const double numbers::PI = 3.14159265358979323846 [static]

pi

const double numbers::PI_2 = 1.57079632679489661923 [static]

pi/2

const double numbers::PI_4 = 0.78539816339744830962 [static]

pi/4

const double numbers::SQRT2 = 1.41421356237309504880 [static]

sqrt(2)

const double numbers::SQRT1_2 = 0.70710678118654752440 [static]

1/sqrt(2)


deal.II documentation generated on Mon Nov 23 22:58:27 2009 by doxygen 1.6.1