25 #include <queso/VectorSet.h>
26 #include <queso/VectorSpace.h>
27 #include <queso/ConcatenationSubset.h>
28 #include <queso/GslVector.h>
29 #include <queso/GslMatrix.h>
34 template<
class V,
class M>
39 :
VectorSubset<V,M>(prefix, vectorSpace, set1.volume()*set2.volume()),
47 template<
class V,
class M>
53 m_sets(sets.size(), (const
VectorSet<V,M>*) NULL)
55 for (
unsigned int i = 0; i <
m_sets.size(); ++i) {
61 template<
class V,
class M>
67 template<
class V,
class M>
72 std::vector<V*> vecs(m_sets.size(),(V*) NULL);
73 for (
unsigned int i = 0; i < vecs.size(); ++i) {
74 vecs[i] =
new V(m_sets[i]->vectorSpace().zeroVector());
77 unsigned int cummulativeSize = 0;
78 for (
unsigned int i = 0; i < vecs.size(); ++i) {
79 vec.cwExtract(cummulativeSize,*(vecs[i]));
80 cummulativeSize += vecs[i]->sizeLocal();
85 for (
unsigned int i = 0; i < m_sets.size(); ++i) {
86 result = result && m_sets[i]->contains(*(vecs[i]));
88 for (
unsigned int i = 0; i < vecs.size(); ++i) {
96 template <
class V,
class M>
99 os <<
"In ConcatenationSubset<V,M>::print()"
100 <<
": m_sets.size() = " << m_sets.size()
102 for (
unsigned int i = 0; i < m_sets.size(); ++i) {
103 os <<
"m_sets[" << i <<
"] = " << *(m_sets[i]);
104 if (i < (m_sets.size()-1)) {
std::vector< const VectorSet< V, M > * > m_sets
A templated class for handling sets.
A templated class representing the concatenation of two vector subsets.
#define queso_require_equal_to_msg(expr1, expr2, msg)
ConcatenationSubset(const char *prefix, const VectorSpace< V, M > &vectorSpace, const VectorSet< V, M > &set1, const VectorSet< V, M > &set2)
Constructor - two sets only.
A templated class for handling subsets.
void print(std::ostream &os) const
Prints the subsets (via protected attribute m_sets).
bool contains(const V &vec) const
Determines whether each one of the subsets m_sets (class' private attributes) contains vector vec...
~ConcatenationSubset()
Destructor.
A class representing a vector space.