17 #ifndef OPENKALMAN_CONSTANT_MDSPAN_POLICIES_HPP 18 #define OPENKALMAN_CONSTANT_MDSPAN_POLICIES_HPP 30 template<
class Extents>
33 using extents_type = Extents;
34 using index_type =
typename extents_type::index_type;
35 using size_type =
typename extents_type::size_type;
36 using rank_type =
typename extents_type::rank_type;
40 mapping(
const extents_type& e) : extents_(e) {}
42 constexpr
const extents_type&
43 extents()
const noexcept {
return extents_; }
47 operator() (std::convertible_to<index_type>
auto...i)
const 49 template<
typename...IndexTypes, std::enable_if_t<
50 (... and std::is_convertible_v<IndexTypes, index_type>),
int> = 0>
52 operator() (IndexTypes...i)
const 59 required_span_size()
const noexcept
61 for(
unsigned r = 0; r < extents_type::rank(); r++)
if (extents().extent(r) == 0)
return 0;
65 static constexpr
bool is_always_unique() noexcept {
return false; }
66 static constexpr
bool is_always_exhaustive() noexcept {
return false; }
67 static constexpr
bool is_always_strided() noexcept {
return false; }
69 constexpr
bool is_unique()
const {
return false; }
70 constexpr
bool is_exhaustive()
const {
return false; }
71 constexpr
bool is_strided()
const {
return false; }
74 stride(std::size_t)
const {
return 0; }
76 template<
class OtherExtents>
80 return lhs.extents() == rhs.extents();
85 extents_type extents_;
95 template<
typename ElementType>
97 using element_type = ElementType;
98 using reference =
const element_type;
99 using data_handle_type = element_type;
104 #ifdef __cpp_concepts 105 template<stdex::convertible_to<element_type> OtherElementType> requires
106 (not std::is_same_v<element_type, OtherElementType>)
108 template<
typename OtherElementType, std::enable_if_t<
109 stdex::convertible_to<OtherElementType, element_type> and
110 (not std::is_same_v<element_type, OtherElementType>),
int> = 0>
115 access(data_handle_type p, std::size_t)
const noexcept {
return std::move(p); }
117 constexpr data_handle_type
118 offset(data_handle_type p, std::size_t)
const noexcept {
return std::move(p); }
Definition: constant_mdspan_policies.hpp:31
Definition: basics.hpp:41
Definition: constant_mdspan_policies.hpp:96
decltype(auto) constexpr access(Arg &&arg, const Indices &indices)
Access a component of an indexible object at a given set of indices.
Definition: access.hpp:74
Basic definitions for OpenKalman as a whole.
Definition: constant_mdspan_policies.hpp:28