queso-0.51.1
VectorSet.h
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 #ifndef UQ_VECTOR_SET_H
26 #define UQ_VECTOR_SET_H
27 
28 #include <queso/Environment.h>
29 #include <queso/Defines.h>
30 
31 namespace QUESO {
32 
45 template <class V, class M>
47 
48 template <class V, class M>
49 class VectorSet
50 {
51 public:
53 
54 
56  VectorSet();
57 
59 
60  VectorSet(const BaseEnvironment& env, const char* prefix, double volume);
61 
63  virtual ~VectorSet();
65 
67 
68  const BaseEnvironment& env () const;
70 
72  const std::string& prefix () const;
74 
76 
77  double volume () const;
79 
81  virtual const VectorSpace<V,M>& vectorSpace() const = 0;
82 
84  virtual bool contains (const V& vec) const = 0;
86 
88 
89  virtual void print (std::ostream& os) const;
91  friend std::ostream & operator<<(std::ostream & os,
92  const VectorSet<V, M> & obj) {
93  obj.print(os);
94  return os;
95  }
97 
98 protected:
100  std::string m_prefix;
101  double m_volume;
102 };
103 
104 } // End namespace QUESO
105 
106 #endif // UQ_VECTOR_SET_H
virtual bool contains(const V &vec) const =0
Checks whether a set contains vector vec. See template specialization.
const std::string & prefix() const
Access to private attribute m_prefix.
Definition: VectorSet.C:88
A templated class for handling sets.
Definition: VectorSet.h:49
virtual void print(std::ostream &os) const
Prints nothing.
Definition: VectorSet.C:102
friend std::ostream & operator<<(std::ostream &os, const VectorSet< V, M > &obj)
Definition: VectorSet.h:91
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
std::string m_prefix
Definition: VectorSet.h:100
A class representing a vector space.
Definition: VectorSet.h:46
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
double volume() const
Set volume; access to private attribute m_volume.
Definition: VectorSet.C:95

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