template <typename number>
struct NumberTraits
{
+ /**
+ * A flag that specifies whether the
+ * template type given to this class is
+ * complex or real. Since the general
+ * template is selected for non-complex
+ * types, the answer is
+ * <code>false</code>.
+ */
+ static const bool is_complex = false;
+
/**
* For this data type, typedef the
* corresponding real type. Since the
template <typename number>
struct NumberTraits<std::complex<number> >
{
+ /**
+ * A flag that specifies whether the
+ * template type given to this class is
+ * complex or real. Since this
+ * specialization of the general
+ * template is selected for complex
+ * types, the answer is
+ * <code>true</code>.
+ */
+ static const bool is_complex = true;
+
/**
* For this data type, typedef the
* corresponding real type. Since this
&&
is_finite (x.imag()) );
}
+
+
+ template <typename number>
+ const bool NumberTraits<number>::is_complex;
+
+ template <typename number>
+ const bool NumberTraits<std::complex<number> >::is_complex;
+
+// explicit instantiations
+ 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> >;
}
DEAL_II_NAMESPACE_CLOSE