Files
2025-10-25 03:02:53 +03:00

3.0 KiB
Raw Permalink Blame History

[mdspan.layout.general]

23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.4 Layout mapping [mdspan.layout]

23.7.3.4.1 General [mdspan.layout.general]

1

#

In [mdspan.layout.reqmts] and [mdspan.layout.policy.reqmts]:

  • (1.1)

    M denotes a layout mapping class.

  • (1.2)

    m denotes a (possibly const) value of type M.

  • (1.3)

    i and j are packs of (possibly const) integers that are multidimensional indices in m.extents() ([mdspan.overview]). [Note 1: The type of each element of the packs can be a different integer type. — end note]

  • (1.4)

    r is a (possibly const) rank index of typename M::extents_type.

  • (1.5)

    dr is a pack of (possibly const) integers for which sizeof...(dr) == M::extents_type::rank() is true, the rth element is equal to 1, and all other elements are equal to 0.

2

#

In [mdspan.layout.reqmts] through [mdspan.layout.stride]:

Let is-mapping-of be the exposition-only variable template defined as follows:template<class Layout, class Mapping>constexpr bool is-mapping-of = // exposition only is_same_v<typename Layout::template mapping, Mapping>;

Let is-layout-left-padded-mapping-of be the exposition-only variable template defined as follows:templateconstexpr bool is-layout-left-padded-mapping-of = see below; // exposition only where is-layout-left-padded-mapping-of is true if and only if Mapping denotes a specialization of layout_left_padded::mapping for some value S of type size_t.

Let is-layout-right-padded-mapping-of be the exposition-only variable template defined as follows:templateconstexpr bool is-layout-right-padded-mapping-of = see below; // exposition only where is-layout-right-padded-mapping-of is true if and only if Mapping denotes a specialization of layout_right_padded::mapping for some value S of type size_t.

For nonnegative integers x and y, let LEAST-MULTIPLE-AT-LEAST(x,y) denote

y if x is zero,

otherwise, the least multiple of x that is greater than or equal to y.