|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Shape (per-axis sizes) of an mdspan, mixing compile-time and run-time extents.
More...
#include <ah-mdspan.H>
Public Types | |
| using | index_type = IndexType |
| using | size_type = std::make_unsigned_t< IndexType > |
| using | rank_type = size_t |
Public Member Functions | |
| constexpr | extents () noexcept |
| All-static-or-default-initialised extents (dynamic axes start at 0). | |
| template<class... IndexTypes> requires (sizeof...(IndexTypes) == mdspan_detail::count_dynamic<Exts...> and (std::is_convertible_v<IndexTypes, IndexType> and ...)) | |
| constexpr | extents (IndexTypes... dyn) noexcept |
| Construct providing a value for each dynamic axis, in rank order. | |
| template<class OtherIndexType > requires std::is_convertible_v<const OtherIndexType &, IndexType> | |
| constexpr | extents (const std::array< OtherIndexType, mdspan_detail::count_dynamic< Exts... > > &dyn) noexcept |
| Construct providing every dynamic axis's value packed in an array. | |
| constexpr index_type | extent (rank_type r) const noexcept |
Run-time size of axis r. | |
Static Public Member Functions | |
| static constexpr rank_type | rank () noexcept |
| Number of axes (compile-time constant). | |
| static constexpr rank_type | rank_dynamic () noexcept |
Number of axes whose extent is dynamic_extent (compile-time constant). | |
| static constexpr size_t | static_extent (rank_type r) noexcept |
Compile-time size of axis r, or dynamic_extent if axis r is dynamic. | |
Private Attributes | |
| std::array< IndexType, sizeof...(Exts)> | values_ {} |
Static Private Attributes | |
| static constexpr std::array< size_t, sizeof...(Exts)> | Static {Exts...} |
Friends | |
| constexpr bool | operator== (const extents &a, const extents &b) noexcept |
Shape (per-axis sizes) of an mdspan, mixing compile-time and run-time extents.
| IndexType | signed or unsigned integral type used for indices. |
| Exts | one size per axis: either a fixed value known at compile time, or Aleph::dynamic_extent for an axis whose size is only known at construction time. rank() is sizeof...(Exts). |
std::extents: every axis (static or dynamic) is stored at run time in this polyfill, so the object does not shrink when axes are marked static. This has no effect on any currently-supported Aleph use case, which always uses dextents (fully dynamic). Definition at line 302 of file ah-mdspan.H.
| using Aleph::extents< IndexType, Exts >::index_type = IndexType |
Definition at line 312 of file ah-mdspan.H.
| using Aleph::extents< IndexType, Exts >::rank_type = size_t |
Definition at line 314 of file ah-mdspan.H.
| using Aleph::extents< IndexType, Exts >::size_type = std::make_unsigned_t<IndexType> |
Definition at line 313 of file ah-mdspan.H.
|
inlineconstexprnoexcept |
All-static-or-default-initialised extents (dynamic axes start at 0).
Definition at line 329 of file ah-mdspan.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::dynamic_extent, r, Aleph::extents< IndexType, Exts >::rank(), Aleph::extents< IndexType, Exts >::Static, and Aleph::extents< IndexType, Exts >::values_.
Referenced by TEST().
|
inlineexplicitconstexprnoexcept |
Construct providing a value for each dynamic axis, in rank order.
| dyn | one value per axis for which static_extent(r) == dynamic_extent, in increasing rank order. Static axes need no argument; their compile-time value is used unconditionally. |
Definition at line 344 of file ah-mdspan.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::dynamic_extent, k, r, Aleph::extents< IndexType, Exts >::rank(), Aleph::extents< IndexType, Exts >::Static, and Aleph::extents< IndexType, Exts >::values_.
|
inlineexplicitconstexprnoexcept |
Construct providing every dynamic axis's value packed in an array.
| dyn | one value per dynamic axis, in rank order; dyn.size() must equal rank_dynamic(). |
Definition at line 359 of file ah-mdspan.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::dynamic_extent, k, r, Aleph::extents< IndexType, Exts >::rank(), Aleph::extents< IndexType, Exts >::Static, and Aleph::extents< IndexType, Exts >::values_.
|
inlineconstexprnoexcept |
Run-time size of axis r.
| r | The axis to query. |
Definition at line 372 of file ah-mdspan.H.
References r, and Aleph::extents< IndexType, Exts >::values_.
|
inlinestaticconstexprnoexcept |
Number of axes (compile-time constant).
Definition at line 317 of file ah-mdspan.H.
Referenced by Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), and Aleph::extents< IndexType, Exts >::extents().
|
inlinestaticconstexprnoexcept |
Number of axes whose extent is dynamic_extent (compile-time constant).
Definition at line 320 of file ah-mdspan.H.
References Aleph::blossom_maximum_cardinality_matching().
|
inlinestaticconstexprnoexcept |
Compile-time size of axis r, or dynamic_extent if axis r is dynamic.
Definition at line 326 of file ah-mdspan.H.
References r, and Aleph::extents< IndexType, Exts >::Static.
|
friend |
Definition at line 374 of file ah-mdspan.H.
|
staticconstexprprivate |
Definition at line 307 of file ah-mdspan.H.
Referenced by Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), and Aleph::extents< IndexType, Exts >::static_extent().
|
private |
Definition at line 309 of file ah-mdspan.H.
Referenced by Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), and Aleph::extents< IndexType, Exts >::extent().