queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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 
33 class GslVector;
34 class GslMatrix;
35 
48 template <class V, class M>
50 
51 template <class V = GslVector, class M = GslMatrix>
52 class VectorSet
53 {
54 public:
56 
57 
59  VectorSet(const BaseEnvironment& env, const char* prefix, double volume);
60 
62  virtual ~VectorSet();
64 
66 
67  const BaseEnvironment& env () const;
69 
71  const std::string& prefix () const;
73 
75 
76  double volume () const;
78 
80  virtual const VectorSpace<V,M>& vectorSpace() const = 0;
81 
83  virtual bool contains (const V& vec) const = 0;
84 
86  virtual void centroid (V& vec) const = 0;
87 
89  virtual void moments (M& mat) const = 0;
91 
93 
94  virtual void print (std::ostream& os) const;
96  friend std::ostream & operator<<(std::ostream & os,
97  const VectorSet<V, M> & obj) {
98  obj.print(os);
99  return os;
100  }
102 
103 protected:
105  std::string m_prefix;
106  double m_volume;
107 
108 private:
110 
111  VectorSet();
112 };
113 
114 } // End namespace QUESO
115 
116 #endif // UQ_VECTOR_SET_H
VectorSet()
Default Constructor.
Definition: VectorSet.C:37
A class representing a vector space.
Definition: VectorSet.h:49
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:198
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:84
double volume() const
Set volume; access to private attribute m_volume.
Definition: VectorSet.C:91
A templated class for handling sets.
Definition: VectorSet.h:52
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
const BaseEnvironment & m_env
Definition: VectorSet.h:104
virtual void centroid(V &vec) const =0
Returns the set centroid in the vector vec. See template specialization.
virtual ~VectorSet()
Virtual destructor.
Definition: VectorSet.C:63
friend std::ostream & operator<<(std::ostream &os, const VectorSet< V, M > &obj)
Definition: VectorSet.h:96
virtual void print(std::ostream &os) const
Prints nothing.
Definition: VectorSet.C:98
std::string m_prefix
Definition: VectorSet.h:105
virtual void moments(M &mat) const =0
Returns the set moments of inertia in the matrix mat. See template specialization.
const BaseEnvironment & env() const
Environment. Access to private attribute m_env.
Definition: VectorSet.C:78

Generated on Tue Jun 5 2018 19:48:54 for queso-0.57.1 by  doxygen 1.8.5