Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
Constant Time Complexity

Functions with constant time complexity, noted $O(1)\,$, will run and return their output in very similar amounts of time regardless of any other factors, such as number of elements in a container, size of a range evaluated, etc.

For example, the function size() of a container always runs in a constant amount of time, regardless of the number of elements contained in the container.

That is because, in order to improve the speed of the function, we sacrifice some memory space, by storing a cached value of the number of elements. The function could be written in this way:

size_type size() const
{
return this->cached_sized;
}

And fetching an integer value from a location in memory takes similar amount of time everytime, and it is not dependant on the number of element in the container.

Member spatial::mapping_end (Container &container, dimension_type mapping_dim)
This function has guarenteed constant time complexity: $O(1)\,$
Member spatial::ordered_end (const Container &container)
This function has guarenteed constant time complexity: $O(1)\,$
Member spatial::ordered_end (Container &container)
This function has guarenteed constant time complexity: $O(1)\,$