// $Id$
// Version: $Name$
//
-// Copyright (C) 2006, 2007 by the deal.II authors
+// Copyright (C) 2006, 2007, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* array size, and the
* like.
*/
- static const unsigned int
+ static const unsigned int
invalid_unsigned_int = static_cast<unsigned int> (-1);
/**
bool is_finite (const double x);
/**
- * Return @p true if real and
+ * Return @p true if real and
* imaginary parts of the given
* complex number are finite.
*/
- bool is_finite (const std::complex<double> x);
+ bool is_finite (const std::complex<double> &x);
/**
- * Return @p true if real and
+ * Return @p true if real and
* imaginary parts of the given
* complex number are finite.
*/
- bool is_finite (const std::complex<float> x);
-
+ bool is_finite (const std::complex<float> &x);
+
/**
- * Return @p true if real and
+ * Return @p 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 <code>double</code>, but
- * finite with respect to
+ * real or imaginary parts are very
+ * large numbers that are infinite in
+ * terms of <code>double</code>, but
+ * finite with respect to
* <code>long double</code>.
*/
- bool is_finite (const std::complex<long double> x);
+ bool is_finite (const std::complex<long double> &x);
/**
* A structure that, together with
* <code>false</code>.
*/
static const bool is_complex = false;
-
+
/**
* For this data type, typedef the
* corresponding real type. Since the
* <code>true</code>.
*/
static const bool is_complex = true;
-
+
/**
* For this data type, typedef the
* corresponding real type. Since this
static
real_type abs (const std::complex<number> &x);
};
-
+
}
{
return std::norm (x);
}
-
+
}
-
+
DEAL_II_NAMESPACE_CLOSE
// $Id$
// Version: $Name$
//
-// Copyright (C) 2006, 2007 by the deal.II authors
+// Copyright (C) 2006, 2007, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
DEAL_II_NAMESPACE_OPEN
-namespace numbers
+namespace numbers
{
- bool is_finite (const double x)
+ bool is_finite (const double x)
{
#ifdef DEAL_II_HAVE_ISFINITE
return std::isfinite (x);
- bool is_finite (const std::complex<double> x)
+ bool is_finite (const std::complex<double> &x)
{
// Check complex numbers for infinity
// by testing real and imaginary part
- return ( is_finite (x.real())
- &&
+ return ( is_finite (x.real())
+ &&
is_finite (x.imag()) );
}
- bool is_finite (const std::complex<float> x)
+ bool is_finite (const std::complex<float> &x)
{
// Check complex numbers for infinity
// by testing real and imaginary part
- return ( is_finite (x.real())
- &&
+ return ( is_finite (x.real())
+ &&
is_finite (x.imag()) );
}
- bool is_finite (const std::complex<long double> x)
+ bool is_finite (const std::complex<long double> &x)
{
// Same for std::complex<long double>
- return ( is_finite (x.real())
- &&
+ return ( is_finite (x.real())
+ &&
is_finite (x.imag()) );
}
template struct NumberTraits<double>;
template struct NumberTraits<float>;
template struct NumberTraits<long double>;
-
+
template struct NumberTraits<std::complex<double> >;
template struct NumberTraits<std::complex<float> >;
template struct NumberTraits<std::complex<long double> >;