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

Public Types | |
| using | layout_type = layout_right |
The tag type of the layout used by this mapping. | |
Public Member Functions | |
| constexpr | mapping () noexcept |
| Construct a right-strided mapping for a default-constructed set of extents. | |
| constexpr | mapping (extents_type const &exts) noexcept |
| Construct a right-strided mapping for the given extents. | |
| template<typename OtherExtents> | |
| constexpr | mapping (layout_left::mapping< OtherExtents > const &other) noexcept |
Converting constructor from a layout_left::mapping when both have 0- or 1-dimensional extents. | |
| template<typename OtherExtents> | |
| constexpr | mapping (layout_left::mapping< OtherExtents > const &other) noexcept |
Converting constructor from a layout_left::mapping when both have 0- or 1-dimensional extents. | |
| template<typename OtherExtents, constraints< std::enable_if_t< std::is_constructible< extents_type, OtherExtents >::value >, std::enable_if_t< OtherExtents::rank()==rank_type{0U}> > = nullptr> | |
| constexpr | mapping (layout_stride::mapping< OtherExtents > const &other) noexcept |
Converting constructor from a layout_stride::mapping with a compatible extents_type. | |
| template<typename OtherExtents, constraints< std::enable_if_t< std::is_constructible< extents_type, OtherExtents >::value >, std::enable_if_t<(OtherExtents::rank() > rank_type{0U})>> | |
| constexpr | mapping (layout_stride::mapping< OtherExtents > const &other) noexcept |
Converting constructor from a layout_stride::mapping with a compatible extents_type. | |
| template<typename OtherExtents, constraints< std::enable_if_t< std::is_convertible< OtherExtents, extents_type >::value > > = nullptr> | |
| constexpr | mapping (mapping< OtherExtents > const &other) noexcept |
Converting constructor from a mapping with a different (but compatible) extents_type. | |
| template<typename OtherExtents, constraints< std::enable_if_t< std::is_constructible< extents_type, OtherExtents >::value >, std::enable_if_t<!std::is_convertible< OtherExtents, extents_type >::value > > = nullptr> | |
| constexpr | mapping (mapping< OtherExtents > const &other) noexcept |
Converting constructor from a mapping with a different (but compatible) extents_type. | |
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. | |
| static constexpr auto | is_exhaustive () noexcept -> bool |
| Return whether or not this instance is exhaustive, i.e. every element is reachable using some indices. | |
Friends | |
| template<typename OtherExtents, constraints< std::enable_if_t< extents_type::rank()==OtherExtents::rank()> > = nullptr> | |
| constexpr auto | operator!= (mapping const &left, mapping< OtherExtents > const &right) noexcept -> bool |
| Compare two right-strided mappings for inequality. | |
| template<typename OtherExtents, constraints< std::enable_if_t< extents_type::rank()==OtherExtents::rank()> > = nullptr> | |
| constexpr auto | operator== (mapping const &left, mapping< OtherExtents > const &right) noexcept -> bool |
| Compare two right-strided mappings for equality. | |
| template<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 (mapping const &src, CanonicalSliceSpecifiers... slices) noexcept -> CanonicalSliceSpecifiers... > >(mdspan_detail::is_submdspan_layout_preserving< layout_right, submdspan_subextents_type_t< extents_type, CanonicalSliceSpecifiers... >::rank(), CanonicalSliceSpecifiers... >{}, src, mapping::passkey(), mapping::strides_of(src), std::move(slices)...)) |
Compute the sub-mapping for a layout_right::mapping. | |
A mapping from a logical pack of indices into a single flat physical output index.
| The | extents of the space used for this mapping; must be a specialization of extents |
| using arene::base::layout_right::mapping< Extents >::layout_type = layout_right |
The tag type of the layout used by this mapping.
|
inlineconstexprnoexcept |
Construct a right-strided mapping for a default-constructed set of extents.
|
inlineconstexprnoexcept |
Construct a right-strided mapping for the given extents.
| exts | The extents to use |
exts fits within index_type, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Converting constructor from a mapping with a different (but compatible) extents_type.
OtherExtents is implicitly convertible to extents_type | OtherExtents | Type of other's extents |
| other | The other layout_right::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation
|
inlineexplicitconstexprnoexcept |
Converting constructor from a mapping with a different (but compatible) extents_type.
OtherExtents is implicitly convertible to extents_type | OtherExtents | Type of other's extents |
| other | The other layout_right::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Converting constructor from a layout_left::mapping when both have 0- or 1-dimensional extents.
OtherExtents is implicitly convertible to extents_type | OtherExtents | Type of other's extents |
| other | The layout_left::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation
|
inlineexplicitconstexprnoexcept |
Converting constructor from a layout_left::mapping when both have 0- or 1-dimensional extents.
OtherExtents is implicitly convertible to extents_type | OtherExtents | Type of other's extents |
| other | The layout_left::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Converting constructor from a layout_stride::mapping with a compatible extents_type.
OtherExtents::rank() == 0 | OtherExtents | Type of other's extents |
| other | The layout_stride::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation other's strides are exactly those of a layout_right::mapping with its extents, else ARENE_PRECONDITION violation
|
inlineexplicitconstexprnoexcept |
Converting constructor from a layout_stride::mapping with a compatible extents_type.
OtherExtents::rank() == 0 | OtherExtents | Type of other's extents |
| other | The layout_stride::mapping |
other.required_span_size() can be represented as a value of this type's index_type, else ARENE_PRECONDITION violation other's strides are exactly those of a layout_right::mapping with its extents, else ARENE_PRECONDITION violation
|
inlinestaticconstexprnoexcept |
Return whether or not this mapping is always exhaustive, i.e. every element is reachable using some indices.
true because the mapping is always computed by a simple invertible right-strided algorithm
|
inlinestaticconstexprnoexcept |
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 right-strided mappings for inequality.
| OtherExtents | The type of the extents used by the right-hand side of the comparison |
| left | An instance of layout_right::mapping |
| right | An instance of layout_right::mapping<OtherExtents> |
true if left and right have unequal extents
|
friend |
Compare two right-strided mappings for equality.
| OtherExtents | The type of the extents used by the right-hand side of the comparison |
| left | An instance of layout_right::mapping |
| right | An instance of layout_right::mapping<OtherExtents> |
true if left and right have equal extents
|
friend |
Compute the sub-mapping for a layout_right::mapping.
| CanonicalSliceSpecifiers | types of the slice specifiers, one per dimension |
| src | the source mapping to slice |
| slices | the 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() layout_right specialization of submdspan_mapping produces a layout_right::mapping if: [SubExtents::rank() - 1, extents_type::rank()) , CanonicalSliceSpecifiers...[k] denotes full_extent_t; and extents_type::rank() - SubExtents::rank() , CanonicalSliceSpecifiers...[k] is a unit-stride slice type;layout_stride::mapping.