Capacity and Reference Points
Method |
---|
MultimapContainer |
Check size |
[[nodiscard]] bool empty() const noexcept; |
[[nodiscard]] size_type size() const noexcept; |
[[nodiscard]] size_type max_size() const noexcept; |
SpatialContainer |
Check dimensions |
[[nodiscard]] size_t dimensions() const noexcept; |
Get max/min values |
dimension_type max_value(size_t dimension) const; |
dimension_type min_value(size_t dimension) const; |
Parameters
dimension
- index of the dimension for which we want the minimum or maximum value
Return value
empty()
-true
if and only if container (equivalent but more efficient thanbegin() == end()
)size()
- The number of elements in the containermax_size()
- An upper bound on the maximum number of elements the container can holddimensions()
- Number of dimensions in the container (same asM
, whenM != 0
)max_value()
- Maximum value in a given dimensionmin_value()
- Minimum value in a given dimension
Complexity
\[
O(1)
\]
Notes
Because all container nodes keep their minimum bounding rectangles, we can get these values in constant time.
Example
Continuing from the previous example:
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 4 5 6 7 8 9 |
|