git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32456
0785d39b-7218-0410-832d-
ea1e28bc413d
*/
static
real_type abs (const number &x);
+
+ /**
+ * Return true if this number is zero.
+ */
+ static
+ bool is_zero (const number &x);
};
*/
static
real_type abs (const std::complex<number> &x);
+
+ /**
+ * Return true if this number is zero.
+ */
+ static
+ bool is_zero (const std::complex<number> &x);
};
}
}
+ template <typename number>
+ bool
+ NumberTraits<number>::is_zero (const number &x)
+ {
+ if (x == 0)
+ return true;
+ else
+ return false;
+ }
+
template <typename number>
std::complex<number>
return std::norm (x);
}
+
+ template <typename number>
+ bool
+ NumberTraits<std::complex<number> >::is_zero (const std::complex<number> &x)
+ {
+ if ((std::real (x) == 0) && (std::imag (x) == 0))
+ return true;
+ else
+ return false;
+ }
+
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams