queso-0.51.1
VectorSubset.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/VectorSubset.h>
26 #include <queso/VectorSpace.h>
27 #include <queso/GslVector.h>
28 #include <queso/GslMatrix.h>
29 
30 namespace QUESO {
31 
32 // Default constructor
33 template <class V, class M>
35  : VectorSet<V,M>(),
36  m_vectorSpace(NULL)
37 {
39  m_env.worldRank(),
40  "VectorSubset<V,M>::constructor(), default",
41  "should not be used by user");
42 }
43 
44 // Shaped constructor
45 template <class V, class M>
47  const VectorSpace<V,M>& vectorSpace,
48  double volume)
49  : VectorSet<V,M>(vectorSpace.env(), prefix, volume),
50  m_vectorSpace(&vectorSpace)
51 {
52  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
53  *m_env.subDisplayFile() << "Entering VectorSubset<V,M>::constructor()"
54  << std::endl;
55  }
56 
57  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
58  *m_env.subDisplayFile() << "Leaving VectorSubset<V,M>::constructor()"
59  << std::endl;
60  }
61 }
62 
63 // Destructor
64 template <class V, class M>
66 {
67  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
68  *m_env.subDisplayFile() << "Entering VectorSubset<V,M>::destructor()"
69  << std::endl;
70  }
71 
72  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
73  *m_env.subDisplayFile() << "Leaving VectorSubset<V,M>::destructor()"
74  << std::endl;
75  }
76 }
77 
78 // Math methods
79 template <class V, class M>
81 {
82  return *m_vectorSpace;
83 }
84 
85 // I/O methods
86 template <class V, class M>
87 void VectorSubset<V,M>::print(std::ostream& os) const
88 {
89  os << "In VectorSubset<V,M>::print()"
90  << ": nothing to be printed" << std::endl;
91  return;
92 }
93 
94 } // End namespace QUESO
95 
A templated class for handling sets.
Definition: VectorSet.h:49
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
const VectorSpace< V, M > & vectorSpace() const
Vector space to which this set belongs to. See template specialization.
Definition: VectorSubset.C:80
A templated class for handling subsets.
Definition: VectorSubset.h:44
virtual void print(std::ostream &os) const
Prints nothing.
Definition: VectorSubset.C:87
const BaseEnvironment & m_env
Definition: VectorSet.h:99
A class representing a vector space.
Definition: VectorSet.h:46
unsigned int displayVerbosity() const
Definition: Environment.C:436
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
VectorSubset()
Default Constructor.
Definition: VectorSubset.C:34
virtual ~VectorSubset()
Destructor.
Definition: VectorSubset.C:65

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