![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
An mdspan layout mapping for the specified ExtentsType.
More...

Public Types | |
| using | extents_type = ExtentsType |
| The type of the extents. | |
| using | index_type = typename extents_type::index_type |
| The index type for the extents. | |
| using | layout_type = layout_constant_diagonal |
| The layout mapping policy type for this mapping. | |
| using | offsets_type = OffsetExtentsType |
| The type of the offsets. | |
| using | rank_type = typename extents_type::rank_type |
| The rank type for the extents. | |
Public Member Functions | |
| constexpr | mapping ()=default |
| Construct the mapping with default-constructed extents and offsets. | |
| constexpr | mapping (extents_type const &source_extents) noexcept |
| Construct the mapping with the specified extents. | |
| constexpr | mapping (extents_type const &source_extents, offsets_type const &offset_extents) noexcept |
| Construct the mapping with the specified extents and offsets. | |
| mapping (mapping &&)=default | |
| Default move constructor. | |
| mapping (mapping const &)=default | |
| Default copy constructor. | |
| ~mapping ()=default | |
| Default destructor. | |
| constexpr auto | extents () const noexcept -> ExtentsType const & |
| Obtain the extents of the layout. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t< SfinaeExtentsType::rank()==0 > > = nullptr> | |
| constexpr auto | is_exhaustive () const noexcept -> bool |
| Check if this layout is exhaustive. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t< layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | is_exhaustive () const noexcept -> bool |
| Check if this layout is exhaustive. | |
| template<typename SfinaeExtentsType = ExtentsType, typename SfinaeOffsets = OffsetExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t<!layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t< SfinaeExtentsType::rank_dynamic()==0 >, std::enable_if_t< SfinaeOffsets::rank_dynamic()==0 >, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | is_exhaustive () const noexcept -> bool |
| Check if this layout is exhaustive. | |
| template<typename SfinaeExtentsType = ExtentsType, typename SfinaeOffsets = OffsetExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t<!layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t<(SfinaeExtentsType::rank_dynamic() !=0)||(SfinaeOffsets::rank_dynamic() !=0)>, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | is_exhaustive () const noexcept -> bool |
| Check if this layout is exhaustive. | |
| constexpr auto | is_unique () const noexcept -> bool |
| Check if there is exactly one index combination for each target element. | |
| constexpr auto | offsets () const noexcept -> OffsetExtentsType const & |
| Obtain the offsets of the layout. | |
| template<typename... Indices, constraints< std::enable_if_t< sizeof...(Indices)==ExtentsType::rank()> > = nullptr> | |
| constexpr auto | operator() (Indices... indices) const noexcept -> index_type |
| Get the index from the underlying storage to use for the specified combination of indices. | |
| auto | operator= (mapping &&) -> mapping &=default |
| Default move constructor. | |
| auto | operator= (mapping const &) -> mapping &=default |
| Default copy assignment operator. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t< SfinaeExtentsType::rank()==0 > > = nullptr> | |
| constexpr auto | required_span_size () const noexcept -> index_type |
| The required span size for the underlying storage. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t< layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | required_span_size () const noexcept -> index_type |
| The required span size for the underlying storage. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t<!layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t< SfinaeExtentsType::rank_dynamic()==0 >, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | required_span_size () const noexcept -> index_type |
| The required span size for the underlying storage. | |
| template<typename SfinaeExtentsType = ExtentsType, arene::base::constraints< std::enable_if_t< std::is_same< SfinaeExtentsType, ExtentsType >::value >, std::enable_if_t<!layout_constant_diagonal_detail::any_static_extents_are_zero< SfinaeExtentsType >()>, std::enable_if_t< SfinaeExtentsType::rank_dynamic() !=0 >, std::enable_if_t< SfinaeExtentsType::rank() !=0 > > = nullptr> | |
| constexpr auto | required_span_size () const noexcept -> index_type |
| The required span size for the underlying storage. | |
| constexpr auto | stride (rank_type) const noexcept -> index_type |
| Get the stride for the provided dimension. Provided for interface compatibility only. | |
Static Public Member Functions | |
| static constexpr auto | is_always_exhaustive () noexcept -> bool |
| Check if this is always an exhaustive layout. | |
| static constexpr auto | is_always_strided () noexcept -> bool |
| Check if this is always a strided layout, which it is not. | |
| static constexpr auto | is_always_unique () noexcept -> bool |
| Check if this is always a unique layout. | |
| static constexpr auto | is_strided () noexcept -> bool |
| Check if this is a strided layout, which it is not. | |
Friends | |
| constexpr auto | operator!= (mapping const &lhs, mapping const &rhs) noexcept -> bool |
| Inequality comparison: two mappings are not equal if they have the different offsets or extents. | |
| constexpr auto | operator== (mapping const &lhs, mapping const &rhs) noexcept -> bool |
| Equality comparison: two mappings are equal if they have the same offsets and extents. | |
An mdspan layout mapping for the specified ExtentsType.
| using arene::base::linalg::layout_constant_diagonal< OffsetExtentsType >::mapping< ExtentsType >::extents_type = ExtentsType |
The type of the extents.
| using arene::base::linalg::layout_constant_diagonal< OffsetExtentsType >::mapping< ExtentsType >::index_type = typename extents_type::index_type |
The index type for the extents.
| using arene::base::linalg::layout_constant_diagonal< OffsetExtentsType >::mapping< ExtentsType >::layout_type = layout_constant_diagonal |
The layout mapping policy type for this mapping.
| using arene::base::linalg::layout_constant_diagonal< OffsetExtentsType >::mapping< ExtentsType >::offsets_type = OffsetExtentsType |
The type of the offsets.
| using arene::base::linalg::layout_constant_diagonal< OffsetExtentsType >::mapping< ExtentsType >::rank_type = typename extents_type::rank_type |
The rank type for the extents.
|
constexprdefault |
Construct the mapping with default-constructed extents and offsets.
|
inlineexplicitconstexprnoexcept |
Construct the mapping with the specified extents.
| source_extents | the extents to use for this mapping |
|
inlineconstexprnoexcept |
Construct the mapping with the specified extents and offsets.
| source_extents | the extents to use for this mapping |
| offset_extents | an extents object specifying the offsets to use for this mapping |
|
default |
Default destructor.
|
default |
Default copy constructor.
|
default |
Default move constructor.
|
inlineconstexprnoexcept |
Obtain the extents of the layout.
ExtentsType object
|
inlinestaticconstexprnoexcept |
Check if this is always an exhaustive layout.
This requires that all extents and offsets are static constants, and that the specific values give an exhaustive layout
true if always unique, false otherwise
|
inlinestaticconstexprnoexcept |
Check if this is always a strided layout, which it is not.
false
|
inlinestaticconstexprnoexcept |
Check if this is always a unique layout.
Identifying all the cases where this is true requires too much implementation complexity, so this function may return false even if the layout is always a unique layout.
true if always unique, false if it may not be always unique
|
inlineconstexprnoexcept |
Check if this layout is exhaustive.
For rank zero layouts, this is always true
true if exhaustive, false otherwise
|
inlineconstexprnoexcept |
Check if this layout is exhaustive.
This is always true for extents that have a dimension with a static extent of zero
true if exhaustive, false otherwise
|
inlineconstexprnoexcept |
Check if this layout is exhaustive.
For non-rank-zero layouts, this depends on the extents and offsets: if there is at least one dimension with an extent of two or more, no dimensions with an extent of zero, and there is at least one value of index for each dimension such that index+offset is the same for all dimensions
true if exhaustive, false otherwise
|
inlineconstexprnoexcept |
Check if this layout is exhaustive.
For non-rank-zero layouts, this depends on the extents and offsets: if there is at least one dimension with an extent of two or more, no dimensions with an extent of zero, and there is at least one value of index for each dimension such that index+offset is the same for all dimensions
true if exhaustive, false otherwise
|
inlinestaticconstexprnoexcept |
Check if this is a strided layout, which it is not.
false
|
inlineconstexprnoexcept |
Check if there is exactly one index combination for each target element.
This must be the case of it returns true, may or not be the case if it returns false ; identifying all the cases where it is true requires too much implementation complexity.
true if conclusively so, false if not guaranteed
|
inlineconstexprnoexcept |
Obtain the offsets of the layout.
OffsetExtentsType object
|
inlineconstexprnoexcept |
Get the index from the underlying storage to use for the specified combination of indices.
| Indices | The types of the indices |
| indices | The indices to retrieve the mapped index for |
Indices must equal ExtentsType::rank()
|
default |
Default move constructor.
|
default |
Default copy assignment operator.
|
inlineconstexprnoexcept |
The required span size for the underlying storage.
This is 1 for a zero-rank mdspan since there is exactly one element
|
inlineconstexprnoexcept |
The required span size for the underlying storage.
This is 0 where any of the extents are statically zero
|
inlineconstexprnoexcept |
The required span size for the underlying storage.
This is 2 where all extents are statically non-zero
|
inlineconstexprnoexcept |
The required span size for the underlying storage.
This is 0 or 2 for a non-zero-rank mdspan : zero where any of the extents are zero, 2 otherwise (on diagonal and off-diagonal)
|
inlineconstexprnoexcept |
Get the stride for the provided dimension. Provided for interface compatibility only.
|
friend |
Inequality comparison: two mappings are not equal if they have the different offsets or extents.
| lhs | The first mapping |
| rhs | The second mapping |
true if the mappings are not the same, false otherwise
|
friend |
Equality comparison: two mappings are equal if they have the same offsets and extents.
| lhs | The first mapping |
| rhs | The second mapping |
true if the mappings are the same, false otherwise