LayoutMapping controls the mapping of a multidimensional index to a one-dimensional offset to data handle in std::mdspan.
[edit] RequirementsA type M
satisfies LayoutMapping if it models copyable
and equality_comparable
, and the following are true:
And, given the following types and values, the expressions shown in the table below are valid and have the indicated semantics:
[edit] Legend Type DefinitionM
a layout mapping class Value Definition m a value of type (possibly const-qualified) M
i, j packs of (possibly const-qualified) integers that are multidimensional indices in m.extents() r a (possibly const-qualified) rank index of typename Mâ::âextents_type d_r a pack of (possibly const-qualified) integers for which sizeof...(d_r) == Mâ::âextents_typeâ::ârank() is true, the element at rank index r is equal to 1, and all other elements are equal to â0â [edit] Member types Name Type Requirements M::extents_type
Specialization of class template std::extents M::index_type
typename M::extents_type::index_type M::rank_type
typename M::extents_type::rank_type M::layout_type
Layout mapping policy MP
where typename MP::template mapping<E> is M
E
LayoutMappingPolicy for which M
is mapping type of MP
[edit] Member functions and operators Expression Return type Semantics m.extents() const typename Mâ::âextents_type& Returns constant reference to associated multidimensional index space m(i...) typename Mâ::âindex_type
[
â0â,
m.required_span_size())
, there exists an i such that m(i...) equals k. [note 2] m.is_strided() bool Returns true only if for every rank index r of m.extents(), there exists an integer s_r such that, for all i where (i + d_r) is a multidimensional index in m.extents(), m((i + d_r)...) - m(i...) equals s_r. [note 3] m.stride(r) typename Mâ::âindex_type
M
. [note 4]M
. [note 5]M
. [note 6]For the constraints uses under std::layout_stride::mapping, the following exposition-only concept is defined.
Defines the minimal usability constraints of the LayoutMapping requirement. This concept checks that the predicate mapping trait functions above exist, are constant expressions, and have a return type of bool.
/*is-extents*/<E> is true if and only if E
is a specialization of std::extents.
The following standard library types satisfy LayoutMapping requirements:
a layout mapping of layout_leftstd::layout_left
)[edit] a layout mapping of layout_right
std::layout_right
)[edit] a layout mapping of layout_stride
std::layout_stride
)[edit] a layout mapping of layout_left_padded
std::layout_left_padded<PaddingValue>
)[edit] a layout mapping of layout_right_padded
std::layout_right_padded<PaddingValue>
)[edit] [edit] See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4