Anasazi
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
AnasaziOutputManager.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Anasazi: Block Eigensolvers Package
4
//
5
// Copyright 2004 NTESS and the Anasazi contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef ANASAZI_OUTPUT_MANAGER_HPP
11
#define ANASAZI_OUTPUT_MANAGER_HPP
12
16
17
#include "
AnasaziConfigDefs.hpp
"
18
#include "
AnasaziTypes.hpp
"
19
20
#include "Teuchos_FancyOStream.hpp"
21
#include "Teuchos_RCP.hpp"
22
#include "Teuchos_oblackholestream.hpp"
23
32
33
namespace
Anasazi
{
34
35
template
<
class
ScalarType>
36
class
OutputManager
{
37
38
public
:
39
41
42
44
OutputManager
(
int
vb =
Anasazi::Errors
,
45
const
Teuchos::RCP<Teuchos::FancyOStream> &fos = Teuchos::getFancyOStream(Teuchos::rcpFromRef(std::cout)) )
46
: vb_(vb),
47
fos_(fos)
48
{
49
bh_fos_ = Teuchos::getFancyOStream(Teuchos::rcpFromRef( myBHS_ ));
50
};
51
53
virtual
~OutputManager
() {};
55
57
58
60
virtual
void
setVerbosity
(
int
vb ) { vb_ = vb; }
61
63
virtual
int
getVerbosity
( )
const
{
return
vb_; }
64
66
virtual
void
setFancyOStream
(
const
Teuchos::RCP<Teuchos::FancyOStream>& fos ) { fos_ = fos; }
67
69
virtual
const
Teuchos::RCP<Teuchos::FancyOStream>&
getFancyOStream
( )
const
{
return
fos_; }
70
72
74
75
77
80
virtual
bool
isVerbosity
(
MsgType
type )
const
;
81
83
virtual
void
print
(
MsgType
type,
const
std::string output );
84
86
virtual
Teuchos::FancyOStream &
stream
(
MsgType
type );
87
89
90
private
:
91
93
94
96
OutputManager
(
const
OutputManager<ScalarType>
& OM );
97
99
OutputManager<ScalarType>
& operator=(
const
OutputManager<ScalarType>
& OM );
100
102
103
protected
:
104
int
vb_;
105
Teuchos::RCP<Teuchos::FancyOStream> fos_, bh_fos_;
106
Teuchos::oblackholestream myBHS_;
107
};
108
109
template
<
class
ScalarType>
110
bool
OutputManager<ScalarType>::isVerbosity
(
MsgType
type )
const
111
{
112
if
( (type & vb_) == type ) {
113
return
true
;
114
}
115
return
false
;
116
}
117
118
template
<
class
ScalarType>
119
void
OutputManager<ScalarType>::print
(
MsgType
type,
const
std::string output )
120
{
121
if
( (type & vb_) == type ) {
122
*fos_ << output;
123
}
124
}
125
126
template
<
class
ScalarType>
127
Teuchos::FancyOStream &
OutputManager<ScalarType>::stream
(
MsgType
type ) {
128
if
( (type & vb_) == type )
129
{
130
return
*fos_;
131
}
132
return
*bh_fos_;
133
}
134
135
}
// end Anasazi namespace
136
137
#endif
138
139
// end of file AnasaziOutputManager.hpp
AnasaziConfigDefs.hpp
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
AnasaziTypes.hpp
Types and exceptions used within Anasazi solvers and interfaces.
Anasazi::OutputManager
Output managers remove the need for the eigensolver to know any information about the required output...
Definition
AnasaziOutputManager.hpp:36
Anasazi::OutputManager::getVerbosity
virtual int getVerbosity() const
Get the message output types for this manager.
Definition
AnasaziOutputManager.hpp:63
Anasazi::OutputManager::setFancyOStream
virtual void setFancyOStream(const Teuchos::RCP< Teuchos::FancyOStream > &fos)
Set the formatted output stream object for this manager.
Definition
AnasaziOutputManager.hpp:66
Anasazi::OutputManager::getFancyOStream
virtual const Teuchos::RCP< Teuchos::FancyOStream > & getFancyOStream() const
Get the formatted output stream object for this manager.
Definition
AnasaziOutputManager.hpp:69
Anasazi::OutputManager::OutputManager
OutputManager(int vb=Anasazi::Errors, const Teuchos::RCP< Teuchos::FancyOStream > &fos=Teuchos::getFancyOStream(Teuchos::rcpFromRef(std::cout)))
Default constructor.
Definition
AnasaziOutputManager.hpp:44
Anasazi::OutputManager::~OutputManager
virtual ~OutputManager()
Destructor.
Definition
AnasaziOutputManager.hpp:53
Anasazi::OutputManager::stream
virtual Teuchos::FancyOStream & stream(MsgType type)
Create a stream for outputting to.
Definition
AnasaziOutputManager.hpp:127
Anasazi::OutputManager::setVerbosity
virtual void setVerbosity(int vb)
Set the message output types for this manager.
Definition
AnasaziOutputManager.hpp:60
Anasazi::OutputManager::print
virtual void print(MsgType type, const std::string output)
Send output to the output manager.
Definition
AnasaziOutputManager.hpp:119
Anasazi::OutputManager::isVerbosity
virtual bool isVerbosity(MsgType type) const
Find out whether we need to print out information for this message type.
Definition
AnasaziOutputManager.hpp:110
Anasazi
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
Anasazi::MsgType
MsgType
Enumerated list of available message types recognized by the eigensolvers.
Definition
AnasaziTypes.hpp:130
Anasazi::Errors
@ Errors
Definition
AnasaziTypes.hpp:131
Generated by
1.17.0