|
dune-common 2.11
|
A layout mapping where the strides are user-defined. More...
#include <dune/common/std/layout_stride.hh>
Public Types | |
| using | extents_type = Extents |
| using | index_type = typename extents_type::index_type |
| using | size_type = typename extents_type::size_type |
| using | rank_type = typename extents_type::rank_type |
| using | layout_type = layout_stride |
Public Member Functions | |
| constexpr | mapping () noexcept |
| The default construction initializes the strides from layout_right. | |
| constexpr | mapping (const mapping &) noexcept=default |
| Copy constructor for the mapping. | |
| template<class OtherIndexType, std::enable_if_t< std::is_convertible_v< const OtherIndexType &, index_type >, int > = 0, std::enable_if_t< std::is_nothrow_constructible_v< index_type, const OtherIndexType & >, int > = 0> | |
| constexpr | mapping (const extents_type &e, const std::array< OtherIndexType, rank_ > &s) noexcept |
| Construct the mapping from given extents and strides. | |
| template<class OtherIndexType, std::enable_if_t< std::is_convertible_v< const OtherIndexType &, index_type >, int > = 0, std::enable_if_t< std::is_nothrow_constructible_v< index_type, const OtherIndexType & >, int > = 0> | |
| constexpr | mapping (const extents_type &e, const std::span< OtherIndexType, rank_ > &s) noexcept |
| Construct the mapping from given extents and strides. | |
| template<class M, std::enable_if_t<(M::extents_type::rank()==extents_type::rank()), int > = 0, std::enable_if_t<(M::is_always_unique()), int > = 0, std::enable_if_t<(M::is_always_strided()), int > = 0, decltype(std::declval< M >().extents(), bool{}) = true, decltype(std::declval< M >().stride(std::declval< rank_type >()), bool{}) = true> | |
| constexpr | mapping (const M &m) noexcept |
| Construct the mapping from another mapping with different extents and different strides. | |
| constexpr mapping & | operator= (const mapping &) noexcept=default |
| Copy-assignment for the mapping. | |
| constexpr const extents_type & | extents () const noexcept |
| constexpr index_type | required_span_size () const noexcept |
| Return the sum 1 + (E(0)-1)*S(0) + (E(1)-1)*S(1) + .... | |
| template<class... Indices, std::enable_if_t<(sizeof...(Indices)==rank_), int > = 0, std::enable_if_t<(std::is_convertible_v< Indices, index_type > &&...), int > = 0, std::enable_if_t<(std::is_nothrow_constructible_v< index_type, Indices > &&...), int > = 0> | |
| constexpr index_type | operator() (Indices... ii) const noexcept |
| Compute the offset by folding with index-array with the strides array. | |
| constexpr index_type | operator() () const noexcept |
| The default offset for rank-0 tensors is 0. | |
| constexpr bool | is_exhaustive () const noexcept |
| constexpr const strides_type & | strides () const noexcept |
| Get the array of all strides. | |
| template<class E = extents_type, std::enable_if_t<(E::rank() > 0), int > = 0> | |
| constexpr index_type | stride (rank_type i) const noexcept |
| Get the single stride i. | |
Static Public Member Functions | |
| static constexpr bool | is_always_unique () noexcept |
| static constexpr bool | is_always_exhaustive () noexcept |
| static constexpr bool | is_always_strided () noexcept |
| static constexpr bool | is_unique () noexcept |
| static constexpr bool | is_strided () noexcept |
Friends | |
| template<class> | |
| class | mapping |
| template<class OtherMapping, std::enable_if_t<(OtherMapping::extents_type::rank()==extents_type::rank()), int > = 0, std::enable_if_t<(OtherMapping::is_always_strided()), int > = 0> | |
| constexpr bool | operator== (const mapping &a, const OtherMapping &b) noexcept |
A layout mapping where the strides are user-defined.
| using Dune::Std::layout_stride::mapping< Extents >::extents_type = Extents |
| using Dune::Std::layout_stride::mapping< Extents >::index_type = typename extents_type::index_type |
| using Dune::Std::layout_stride::mapping< Extents >::layout_type = layout_stride |
| using Dune::Std::layout_stride::mapping< Extents >::rank_type = typename extents_type::rank_type |
| using Dune::Std::layout_stride::mapping< Extents >::size_type = typename extents_type::size_type |
|
inlineconstexprnoexcept |
The default construction initializes the strides from layout_right.
|
constexprdefaultnoexcept |
Copy constructor for the mapping.
|
inlineconstexprnoexcept |
Construct the mapping from given extents and strides.
|
inlineconstexprnoexcept |
Construct the mapping from given extents and strides.
|
inlineconstexprnoexcept |
Construct the mapping from another mapping with different extents and different strides.
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
The default offset for rank-0 tensors is 0.
|
inlineconstexprnoexcept |
Compute the offset by folding with index-array with the strides array.
|
constexprdefaultnoexcept |
Copy-assignment for the mapping.
|
inlineconstexprnoexcept |
Return the sum 1 + (E(0)-1)*S(0) + (E(1)-1)*S(1) + ....
|
inlineconstexprnoexcept |
Get the single stride i.
|
inlineconstexprnoexcept |
Get the array of all strides.
|
friend |
|
friend |