43 #include "Teuchos_Assert.hpp" 49 #ifdef HAVE_TEUCHOSCORE_QUADMATH 53 operator<< (std::ostream& out,
const __float128& x)
55 const size_t bufSize = 128;
58 const int numCharPrinted = quadmath_snprintf (buf, bufSize,
"%.30Qe", x);
59 if (static_cast<size_t> (numCharPrinted) >= bufSize) {
60 std::ostringstream os;
61 os <<
"Failed to print __float128 value: buffer has " << bufSize
62 <<
" characters, but quadmath_snprintf wanted " << numCharPrinted
64 throw std::runtime_error (os.str ());
71 operator>> (std::istream& in, __float128& x)
77 x = strtoflt128 (tmpStr.c_str (), NULL);
82 #endif // HAVE_TEUCHOSCORE_QUADMATH 92 float returnFloatZero() {
return 0.0; }
94 double returnDoubleZero() {
return 0.0; }
99 void Teuchos::throwScalarTraitsNanInfError(
const std::string &errMsg )
101 #ifdef TEUCHOS_SCALAR_TRAITS_THROW_NAN_INF_ERR 106 #ifdef HAVE_TEUCHOS_GNU_MP 107 gmp_randclass Teuchos::gmp_rng ( gmp_randinit_default );
110 #ifdef HAVE_TEUCHOS_QD 111 bool Teuchos::operator&&(
const dd_real &a,
const dd_real &b) {
112 return !a.is_zero() && !b.is_zero();
114 bool Teuchos::operator&&(
const qd_real &a,
const qd_real &b) {
115 return !a.is_zero() && !b.is_zero();
122 const float flt_nan = +returnFloatZero()/returnFloatZero();
123 const double dbl_nan = +returnDoubleZero()/returnDoubleZero();
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
Defines basic traits for the scalar field type.