queso-0.51.1
VectorSet.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/Environment.h>
26 #include <queso/Defines.h>
27 #include <queso/VectorSet.h>
28 #include <queso/GslVector.h>
29 #include <queso/GslMatrix.h>
30 #include <queso/TeuchosVector.h>
31 #include <queso/TeuchosMatrix.h>
32 
33 namespace QUESO {
34 
35 // Default constructor
36 template <class V, class M>
38  : m_env(*(new EmptyEnvironment()))
39 {
41  m_env.worldRank(),
42  "VectorSet<V,M>::constructor(), default",
43  "should not be used by user");
44 }
45 
46 // Shaped constructor
47 template <class V, class M>
48 VectorSet<V,M>::VectorSet(const BaseEnvironment& env, const char * prefix,
49  double volume)
50  : m_env(env),
51  m_prefix(prefix),
52  m_volume(volume)
53 {
54  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
55  *m_env.subDisplayFile() << "Entering VectorSet<V,M>::constructor()"
56  << std::endl;
57  }
58 
59  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
60  *m_env.subDisplayFile() << "Leaving VectorSet<V,M>::constructor()"
61  << std::endl;
62  }
63 }
64 
65 // Destructor
66 template <class V, class M>
68 {
69  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
70  *m_env.subDisplayFile() << "Entering VectorSet<V,M>::destructor()"
71  << std::endl;
72  }
73 
74  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
75  *m_env.subDisplayFile() << "Leaving VectorSet<V,M>::destructor()"
76  << std::endl;
77  }
78 }
79 
80 // Environment methods
81 template <class V, class M>
83 {
84  return m_env;
85 }
86 
87 template <class V, class M>
88 const std::string& VectorSet<V,M>::prefix() const
89 {
90  return m_prefix;
91 }
92 
93 // Mathematical methods
94 template <class V, class M>
95 double VectorSet<V,M>::volume() const
96 {
97  return m_volume;
98 }
99 
100 // I/O methods
101 template <class V, class M>
102 void VectorSet<V,M>::print(std::ostream& os) const
103 {
104  os << "In VectorSet<V,M>::print()"
105  << ": nothing to be printed" << std::endl;
106  return;
107 }
108 
109 } // End namespace QUESO
110 
112 #ifdef QUESO_HAS_TRILINOS
114 #endif
const std::string & prefix() const
Access to private attribute m_prefix.
Definition: VectorSet.C:88
virtual void print(std::ostream &os) const
Prints nothing.
Definition: VectorSet.C:102
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:305
This class sets up the environment underlying the use of the QUESO library by an executable.
Definition: Environment.h:396
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
const BaseEnvironment & m_env
Definition: VectorSet.h:99
VectorSet()
Default Constructor.
Definition: VectorSet.C:37
const BaseEnvironment & env() const
Environment. Access to private attribute m_env.
Definition: VectorSet.C:82
virtual ~VectorSet()
Virtual destructor.
Definition: VectorSet.C:67
unsigned int displayVerbosity() const
Definition: Environment.C:436
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
double volume() const
Set volume; access to private attribute m_volume.
Definition: VectorSet.C:95

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5