Closed crtrott closed 6 years ago
@crtrott It looks like this isn't in the paper yet -- should I add this, or wait for a PR?
No this isn't done yet. We need to finish this definition first. Its kind of complicated ;-)
Check whether this is postcondition or return clause.
Closing this for now. We got a working definition committed.
Not quite done yet:
basic_mdspan
that is a view on a (potentially trivial) subset of anotherbasic_mdspan
.extents
.C
be the number of parameters inSliceSpecifiers
which are convertible toptrdiff_t
ranges[r]
denote the rth value in the parameter pack slices, which is not convertible toptrdiff_t
sub
be the return value ofsubspan
first[r]
denote the rth lower bound ofslices[r]
.slices[r]
is convertible toptrdiff_t
first[r]==slices[r]
slices[r]
is convertible topair<ptrdiff_t,ptrdiff_t>
first[r]==pair<ptrdiff_t,ptrdiff_t>(slices[r]).first()
slices[r]
is convertible toalltype_t
first[r]==0
last[r]
denote the rth upper bound ofslices[r]
.slices[r]
is convertible toptrdiff_t
last[r]==slices[r]+1
slices[r]
is convertible topair<ptrdiff_t,ptrdiff_t>
last[r]==pair<ptrdiff_t,ptrdiff_t>(slices[r]).second()
slices[r]
is convertible toalltype_t
last[r]==src.extent(r)
sizeof(slices...)==Extents::rank()
slices[r]
is convertible toptrdiff_t
,pair<ptrdiff_t,ptrdiff_t>
oralltype_t
0<=first[r]<src.extent(r)
0<last[r]<=src.extent(r)
LayoutPolicy
islayout_right
,layout_left
, orlayout_stride
E::rank() == Extents::rank()-C
ranges[r]
is the nth value ofranges
convertible toalltype_t
orpair<ptrdiff_t,ptrdiff_t>
andslices[k]
is then
th value ofslices
convertible toall type_t
orpair<ptrdiff_t,ptrdiff_t>
thensub.extent(r)==last[k]-first[k]
andsub.stride(r)==src.stride(k)
sub.ptr_==src.ptr_ + first[0]*src.stride(0) + ... + first[Extents::rank()-1]*src.stride(Extents::rank()-1)