Fixed order stride with mixed size capability. More...
#include <kwk/utility/container/stride.hpp>
Fixed order stride with mixed size capability.
Required header:
kwk::stride defines and optimally stores a set of integral values representing the strides used to walk through a given multi-dimensional container or view.
kwk::stride can be defined in two ways:
using the kwk::with_strides function.
defining the layout of the kwk::stride and manually initializing it. The description of the kwk::stride layout is done with the kwk::extent object or one of the pre-defined layouts.
| Strides | An instance of a stride descriptor |
Public Member Functions | |
| constexpr | stride () |
| Constructs a default kwk::stride equals to [1 1 ... 1]. | |
| constexpr | stride (concepts::extent auto... values) noexcept |
| Constructor from set of dimensions. | |
|
template<std::convertible_to< std::ptrdiff_t >... Is> requires ( sizeof...(Is) == static_order ) | |
| constexpr auto | linearize (Is... is) const noexcept |
| Indexing interface. | |
|
template<auto... S2> requires (sizeof...(S2) == static_order) | |
| constexpr bool | operator== (stride< S2... > const &other) const noexcept |
| Equality comparison operator. | |
Static Public Member Functions | |
| static constexpr auto | order () noexcept |
| Number of dimensions. | |
Static Public Attributes | |
| static constexpr auto | is_unit |
| Checks a kwk::stride is unit - ie it's innermost value is statically known to be 1. | |
| static constexpr std::int32_t | static_order = parent::static_size |
| Compile-time value for Order. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, stride const &s) |
| Stream insertion operator. | |