25 #include <queso/VectorSpace.h>
26 #include <queso/BoxSubset.h>
27 #include <queso/GslVector.h>
28 #include <queso/GslMatrix.h>
33 template<
class V,
class M>
39 m_minValues(minValues),
40 m_maxValues(maxValues)
42 queso_require_equal_to_msg(minValues.sizeLocal(), maxValues.sizeLocal(),
"vectors 'minValues' and 'maxValues' should have the same size");
43 queso_require_equal_to_msg(minValues.sizeLocal(), vectorSpace.
dimLocal(),
"sizes of vectors 'minValues' and 'maxValues' should be equal to dimension of the vector space");
44 for (
unsigned int i = 0; i <
m_vectorSpace->dimLocal(); ++i) {
49 for (
unsigned int i = 0; i <
m_vectorSpace->dimLocal(); ++i) {
55 template<
class V,
class M>
61 template<
class V,
class M>
67 return (!vec.atLeastOneComponentSmallerThan(m_minValues) &&
68 !vec.atLeastOneComponentBiggerThan (m_maxValues));
72 template<
class V,
class M>
78 template<
class V,
class M>
85 template <
class V,
class M>
88 os <<
"In BoxSubset<V,M>::print()"
89 <<
": m_minValues = " << m_minValues
90 <<
", m_maxValues = " << m_maxValues
91 <<
", m_volume = " << m_volume
unsigned int dimLocal() const
bool contains(const V &vec) const
Checks whether this box subset contains vector vec.
#define queso_require_less_equal_msg(expr1, expr2, msg)
#define queso_require_equal_to_msg(expr1, expr2, msg)
void print(std::ostream &os) const
Prints the volume, the minimum and the maximum values of this.
const V & maxValues() const
Vector of the maximum values of the box subset.
A templated class for handling subsets.
const V & minValues() const
Vector of the minimum values of the box subset.
V m_minValues
Vector of templated type V to store the minimum values of the box subset class.
const VectorSpace< V, M > * m_vectorSpace
V m_maxValues
Vector of templated type V to store the maximum values of the box subset class.
BoxSubset(const char *prefix, const VectorSpace< V, M > &vectorSpace, const V &minValues, const V &maxValues)
Shaped, default constructor.
Class representing a subset of a vector space shaped like a hypercube.
A class representing a vector space.