Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos::SetScientific< Scalar, isFloatingPoint > Class Template Reference

Temporarily make an output stream use scientific notation with sufficient precision. More...

#include <Teuchos_SetScientific.hpp>

Detailed Description

template<typename Scalar, const bool isFloatingPoint = ! Teuchos::ScalarTraits<Scalar>::isOrdinal>
class Teuchos::SetScientific< Scalar, isFloatingPoint >

Temporarily make an output stream use scientific notation with sufficient precision.

On construction, apply the necessary flags to the given output stream so that floating-point numbers are written in scientific notation with precision (dependent on the Scalar type) sufficient to ensure that they can be read in with the same value. On destruction, restore the original (pre-construction) flags to the output stream.

This makes SetScientific good for scope-protected alteration of the output stream's flags; no matter how the scope exits (normally or by a thrown exception), the original flags will be restored. Hence, "temporarily" (or even "politely"): we restore the original flags on scope exit.

Template Parameters
ScalarA floating-point type, either real or complex, for which Teuchos::ScalarTraits<Scalar> has a specialization.

Definition at line 73 of file Teuchos_SetScientific.hpp.


The documentation for this class was generated from the following file: