Tpetra Matrix/Vector Services Version of the Day
Public Member Functions
Tpetra::MatrixMarket::details::SetScientific< Scalar > Class Template Reference

Politely make an output stream use scientific notation. More...

#include <MatrixMarket_util.hpp>

List of all members.

Public Member Functions

 SetScientific (std::ostream &out)
 Constructor.
 ~SetScientific ()
 Destructor.

Detailed Description

template<class Scalar>
class Tpetra::MatrixMarket::details::SetScientific< Scalar >

Politely make an output stream use scientific notation.

Author:
Mark Hoemmen

On construction, apply the necessary flags to the given output stream so that floating-point numbers are written in scientific notation with precision appropriate for the Scalar type. 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, "polite": 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. Currently we also require that std::log10() take arguments of type Scalar, but this may be relaxed in the future if Teuchos::ScalarTraits gets its own log10() class method.

Definition at line 74 of file MatrixMarket_util.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Tpetra::MatrixMarket::details::SetScientific< Scalar >::SetScientific ( std::ostream &  out) [inline]

Constructor.

Parameters:
out[in/out] Output stream to which to apply the scientific notation flags.

Definition at line 82 of file MatrixMarket_util.hpp.

template<class Scalar>
Tpetra::MatrixMarket::details::SetScientific< Scalar >::~SetScientific ( ) [inline]

Destructor.

The destructor sets the output stream's flags back to their original state, that is, the state before the constructor of this object was called.

Definition at line 125 of file MatrixMarket_util.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines