![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A mapping from a logical pack of indices into a single flat physical output index, using a strided algorithm. More...

Public Types | |
| using | layout_type = layout_stride |
The tag type of the layout used by this mapping. | |
Public Member Functions | |
| constexpr | mapping () noexcept |
Construct a default strided mapping for the given extents, which has the same layout as layout_right. | |
| constexpr | mapping (extents_type const &exts, array< index_type, extents_type::rank()> const &strds, layout_detail::check_bypasser) noexcept |
| Construct a mapping with the given strides, bypassing precondition checks. | |
| template<class OtherIndexType, constraints< std::enable_if_t< std::is_convertible< OtherIndexType const &, index_type >::value >, std::enable_if_t< std::is_nothrow_constructible< index_type, OtherIndexType const & >::value > > = nullptr> | |
| constexpr | mapping (extents_type const &exts, array< OtherIndexType, extents_type::rank()> const &strds) noexcept |
Construct a mapping with the given strides; they must be valid for a default-constructed extents_type. | |
| template<class OtherIndexType, constraints< std::enable_if_t< std::is_convertible< OtherIndexType const &, index_type >::value >, std::enable_if_t< std::is_nothrow_constructible< index_type, OtherIndexType const & >::value > > = nullptr> | |
| constexpr | mapping (extents_type const &exts, span< OtherIndexType, extents_type::rank()> strds) noexcept |
Construct a mapping with the given strides; they must be valid for a default-constructed extents_type. | |
| template<class StridedLayoutMapping, constraints< std::enable_if_t< is_layout_mapping_v< StridedLayoutMapping > >, std::enable_if_t< std::is_constructible< extents_type, typename StridedLayoutMapping::extents_type >::value >, std::enable_if_t< StridedLayoutMapping::is_always_strided()>, std::enable_if_t< StridedLayoutMapping::is_always_unique()>, std::enable_if_t< layout_detail::implicit_conversion_ok< StridedLayoutMapping, mapping >::value > > = nullptr> | |
| constexpr | mapping (StridedLayoutMapping const &other) noexcept |
| Construct a mapping from another strided mapping; implicit for certain known-safe mapping types. | |
| template<class StridedLayoutMapping, constraints< std::enable_if_t< is_layout_mapping_v< StridedLayoutMapping > >, std::enable_if_t< std::is_constructible< extents_type, typename StridedLayoutMapping::extents_type >::value >, std::enable_if_t< StridedLayoutMapping::is_always_strided()>, std::enable_if_t< StridedLayoutMapping::is_always_unique()>, std::enable_if_t<!layout_detail::implicit_conversion_ok< StridedLayoutMapping, mapping >::value > > = nullptr> | |
| constexpr | mapping (StridedLayoutMapping const &other) noexcept |
| Construct a mapping from another strided mapping; implicit for certain known-safe mapping types. | |
| constexpr auto | is_exhaustive () const noexcept -> bool |
| Return whether or not this instance is exhaustive, i.e. every element is reachable using some indices. | |
Static Public Member Functions | |
| static constexpr auto | is_always_exhaustive () noexcept -> bool |
| Return whether or not this mapping is always exhaustive, i.e. every element is reachable using some indices. | |
Friends | |
| template<class Left, constraints< std::enable_if_t<!std::is_same< typename Left::layout_type, layout_stride >::value >, std::enable_if_t< is_layout_mapping_v< Left > >, std::enable_if_t< Left::extents_type::rank()==extents_type::rank()>, std::enable_if_t< Left::is_always_strided()> > = nullptr> | |
| constexpr auto | operator!= (Left const &left, mapping const &right) noexcept -> bool |
Compare two strided mappings for inequality, of which at least one must be a layout_stride::mapping. | |
| template<class Right, constraints< std::enable_if_t< is_layout_mapping_v< Right > >, std::enable_if_t< Right::extents_type::rank()==extents_type::rank()>, std::enable_if_t< Right::is_always_strided()> > = nullptr> | |
| constexpr auto | operator!= (mapping const &left, Right const &right) noexcept -> bool |
Compare two strided mappings for inequality, of which at least one must be a layout_stride::mapping. | |
| template<class Left, constraints< std::enable_if_t<!std::is_same< typename Left::layout_type, layout_stride >::value >, std::enable_if_t< is_layout_mapping_v< Left > >, std::enable_if_t< Left::extents_type::rank()==extents_type::rank()>, std::enable_if_t< Left::is_always_strided()> > = nullptr> | |
| constexpr auto | operator== (Left const &left, mapping const &right) noexcept -> bool |
Compare two strided mappings for equality, of which at least one must be a layout_stride::mapping. | |
| template<class Right, constraints< std::enable_if_t< is_layout_mapping_v< Right > >, std::enable_if_t< Right::extents_type::rank()==extents_type::rank()>, std::enable_if_t< Right::is_always_strided()> > = nullptr> | |
| constexpr auto | operator== (mapping const &left, Right const &right) noexcept -> bool |
Compare two strided mappings for equality, of which at least one must be a layout_stride::mapping. | |
| template<class SrcMapping, class... CanonicalSliceSpecifiers, constraints< std::enable_if_t< sizeof...(CanonicalSliceSpecifiers)==extents_type::rank()>, std::enable_if_t< mdspan_detail::all_valid_submdspan_slice_types_for_v< extents_type, CanonicalSliceSpecifiers... > > > = nullptr> | |
| constexpr auto | submdspan_mapping (SrcMapping const &src, CanonicalSliceSpecifiers... slices) noexcept -> submdspan_mapping_result< layout_stride::mapping< submdspan_subextents_type_t< extents_type, CanonicalSliceSpecifiers... > > > |
compute submdspan mapping and offset for a layout_stride mapping | |
A mapping from a logical pack of indices into a single flat physical output index, using a strided algorithm.
| The | extents of the space used for this mapping; must be a specialization of extents |
| using arene::base::layout_stride::mapping< Extents >::layout_type = layout_stride |
The tag type of the layout used by this mapping.
|
inlineconstexprnoexcept |
Construct a mapping with the given strides, bypassing precondition checks.
| exts | A set of extents to use for this mapping |
| strds | A set of strides to use for this mapping |
|
inlineconstexprnoexcept |
Construct a default strided mapping for the given extents, which has the same layout as layout_right.
|
inlineconstexprnoexcept |
Construct a mapping with the given strides; they must be valid for a default-constructed extents_type.
| OtherIndexType | The original index type used by strds; must be convertible to index_type |
| exts | A set of extents to use for this mapping |
| strds | A set of strides to use for this mapping |
index_type index_type strds defines a unique (one-to-one) mapping from exts
|
inlineconstexprnoexcept |
Construct a mapping with the given strides; they must be valid for a default-constructed extents_type.
| OtherIndexType | The original index type used by strds; must be convertible to index_type |
| exts | A set of extents to use for this mapping |
| strds | A set of strides to use for this mapping |
index_type, else ARENE_PRECONDITION violation index_type, else ARENE_PRECONDITION violation strds defines a unique (one-to-one) mapping from exts, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Construct a mapping from another strided mapping; implicit for certain known-safe mapping types.
| StridedLayoutMapping | A layout mapping satisfying [mdspan.layout.reqmts] which is always strided and unique |
| other | A mapping to convert |
index_type, else ARENE_PRECONDITION violation index_type, else ARENE_PRECONDITION violation other(0, 0, 0...) == 0, else ARENE_PRECONDITION violation
|
inlineexplicitconstexprnoexcept |
Construct a mapping from another strided mapping; implicit for certain known-safe mapping types.
| StridedLayoutMapping | A layout mapping satisfying [mdspan.layout.reqmts] which is always strided and unique |
| other | A mapping to convert |
index_type, else ARENE_PRECONDITION violation index_type, else ARENE_PRECONDITION violation other(0, 0, 0...) == 0, else ARENE_PRECONDITION violation
|
inlinestaticconstexprnoexcept |
Return whether or not this mapping is always exhaustive, i.e. every element is reachable using some indices.
false because it's possible to construct non-exhaustive mappings using this class
|
inlineconstexprnoexcept |
Return whether or not this instance is exhaustive, i.e. every element is reachable using some indices.
true if every provided stride is the product of the extents corresponding to some subset of the other strides, otherwise false
|
friend |
Compare two strided mappings for inequality, of which at least one must be a layout_stride::mapping.
| Left | The type of the left side of the comparison; must be strided and satisfy is_layout_mapping_v |
| left | An instance of Left |
| right | An instance of layout_stride::mapping |
true if left and right have different extents or strides, or one doesn't map (0,0,...) to 0
|
friend |
Compare two strided mappings for inequality, of which at least one must be a layout_stride::mapping.
| Right | The type of the right side of the comparison; must be strided and satisfy is_layout_mapping_v |
| left | An instance of layout_stride::mapping |
| right | An instance of Right |
true if left and right have different extents or strides, or one doesn't map (0,0,...) to 0
|
friend |
Compare two strided mappings for equality, of which at least one must be a layout_stride::mapping.
| Left | The type of the left side of the comparison; must be strided and satisfy is_layout_mapping_v |
| left | An instance of Left |
| right | An instance of layout_stride::mapping |
true if left and right have the same extents and strides, and both map (0,0,...) to 0
|
friend |
Compare two strided mappings for equality, of which at least one must be a layout_stride::mapping.
| Right | The type of the right side of the comparison; must be strided and satisfy is_layout_mapping_v |
| left | An instance of layout_stride::mapping |
| right | An instance of Right |
true if left and right have the same extents and strides, and both map (0,0,...) to 0
|
friend |
compute submdspan mapping and offset for a layout_stride mapping
| CanonicalSliceSpecifiers | submdspan slice specifier types |
| src | source layout_stride::mapping to slice |
| slices | submdspan slice specifiers |
Uses slices to compute the sub-extents, sub-strides, and offset of the submdspan. The slices must be in canonical form.
submdspan_mapping_result containing the sub-mapping and offset such that indexing the sub-mapping and adding the offset recovers the corresponding index in the original mapping. sizeof...(CanonicalSliceSpecifiers) == extents_type::rank() k of src.extents(), CanonicalSliceSpecifiers...[k] is a valid submdspan slice type for the k-th extent of extents_type k of src.extents(), slices...[k] denotes a valid submdspan slice for the k-th extent of src.extents() friend of layout_stride::mapping layout_stride specialization of submdspan_mapping always produces a layout_stride mapping for the submdspan.