28namespace GridContainer {
35 return m_values.size();
45 return m_values[index];
50 return m_values.cbegin();
55 return m_values.end();
62 if (this->size() == other.
size()) {
71 return !this->operator==(other);
76 auto upper_bound =
std::upper_bound(m_values.begin(), m_values.end(), value);
77 if (upper_bound == m_values.begin() || (upper_bound != m_values.end() && *upper_bound == value)) {
80 return upper_bound - 1;
Provides information related with an axis of a GridContainer.
const_iterator begin() const
Returns an iterator at the first knot of the axis.
std::vector< T >::const_iterator const_iterator
The iterator type of the GridAxis.
GridAxis(std::string name, std::vector< T > values)
Constructs an GridAxis with the given name and knot values.
size_t size() const
Returns the number of knots of the axis.
const std::string & name() const
Returns the name of the axis.
const_iterator infimum(const T &value) const
bool operator==(const GridAxis< U > &other) const
Compares the axis with another axis.
bool operator!=(const GridAxis< U > &other) const
The opposite of the == operator.
const T & operator[](size_t index) const
Returns the value of the knot with the given index.
const_iterator end() const
Returns an iterator after the last knot of the axis.