42 #ifndef __Teuchos_MatrixMarket_SetScientific_hpp 43 #define __Teuchos_MatrixMarket_SetScientific_hpp 64 template<
class Scalar, const
bool isFloatingPo
int>
87 template<
class Scalar>
93 out_ (out), originalFlags_ (out.flags())
96 typedef typename STS::magnitudeType magnitude_type;
100 out << std::scientific;
117 const magnitude_type numDecDigits = STM::t() * STM::log10 (STM::base());
122 const magnitude_type one = STM::one();
123 const magnitude_type two = one + one;
126 const int prec = 1 + Teuchos::as<int> (magnitude_type((two*numDecDigits + one) / two));
130 out.precision (prec);
134 out_.flags (originalFlags_);
146 template<
class Scalar>
174 template<
class Scalar>
269 #endif // __Teuchos_MatrixMarket_SetScientific_hpp
Implementation of SetScientific.
SetScientific(std::ostream &out)
SetScientificImpl< Scalar, ! Teuchos::ScalarTraits< Scalar >::isOrdinal > base_type
Parent class of this class.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
SetScientificImpl(std::ostream &out)
This structure defines some basic traits for a scalar field type.
Scalar scalar_type
The Scalar type with which SetScientific was specialized.
SetScientificImpl(std::ostream &)
Scalar scalar_type
The Scalar type with which SetScientific was specialized.
Teuchos implementation details.
std::ostream & out_
The output stream to which to apply flags.
std::ios_base::fmtflags originalFlags_
The output stream's original flags.
Defines basic traits for the scalar field type.
Definition of Teuchos::as, for conversions between types.
Matrix Market file utilities.
Temporarily make an output stream use scientific notation with sufficient precision.
SetScientificImpl(std::ostream &out)