queso-0.53.0
IntersectionSubset.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-2015 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/VectorSpace.h>
26 #include <queso/VectorSet.h>
27 #include <queso/IntersectionSubset.h>
28 #include <queso/GslVector.h>
29 #include <queso/GslMatrix.h>
30 
31 namespace QUESO {
32 
33 // Default, shaped constructor
34 template<class V, class M>
36  const VectorSpace<V,M>& vectorSpace,
37  double volume,
38  const VectorSet<V,M>& set1,
39  const VectorSet<V,M>& set2)
40  : VectorSubset<V,M>(prefix,vectorSpace,volume),
41  m_set1(set1),
42  m_set2(set2)
43 {
44 }
45 
46 // Destructor
47 template<class V, class M>
49 {
50 }
51 
52 // Mathematical methods
53 template<class V, class M>
54 bool IntersectionSubset<V,M>::contains(const V& vec) const
55 {
56  return (m_set1.contains(vec) && m_set2.contains(vec));
57 }
58 
59 // I/O methods
60 template <class V, class M>
61 void IntersectionSubset<V,M>::print(std::ostream& os) const
62 {
63  os << "In IntersectionSubset<V,M>::print()"
64  << ": m_set1 = " << m_set1
65  << ", m_set2 = " << m_set2
66  << std::endl;
67 
68  return;
69 }
70 
71 } // End namespace QUESO
72 
73 
bool contains(const V &vec) const
Determines whether both sets m_set1 and m_set2 (class&#39; private attributes) contain vector vec...
A templated class for handling sets.
Definition: VectorSet.h:52
A templated class representing the intersection of two vector sets.
A templated class for handling subsets.
Definition: VectorSubset.h:46
IntersectionSubset(const char *prefix, const VectorSpace< V, M > &vectorSpace, double volume, const VectorSet< V, M > &set1, const VectorSet< V, M > &set2)
Default, shaped constructor.
void print(std::ostream &os) const
Prints both subsets (via protected attributes m_set1 and m_set2).
A class representing a vector space.
Definition: VectorSet.h:49

Generated on Thu Jun 11 2015 13:52:31 for queso-0.53.0 by  doxygen 1.8.5