Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P0009r8: Fix various issues including #73 #74

Closed
wants to merge 15 commits into from

Conversation

mhoemmen
Copy link
Contributor

@mhoemmen mhoemmen commented Oct 1, 2018

Mark Hoemmen added 15 commits September 26, 2018 17:00
No one else has looked at this commit, so please be sure to review
it with Dan or someone else.
We still need to change DynamicRank and DynamicIndex to use a more
mathematical notation.
Notation improvements include a way of avoiding incorrect syntax
in code font for referring to the entries of a parameter pack.
Permutation is a mathematical object; change wording so that we
clarify the permutation's interaction with code.
Denote the value of the <math>k</math>-th member of `slices...`
by <math>s<sub>k</sub></math>.

Define `rank_map` as the length &rho; `std::integer_sequence` of `ptrdiff_t` consisting of all k such that `is_convertible_v<`<math>s<sub>k</sub></math>`, pair<ptrdiff_t, ptrdiff_t>> || is_convertible_v<`<math>s<sub>k</sub></math>`, all_type>` is `true`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This math wording replaces the code above that defines the rank of the result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in P0009r8-more-math branch.

* For all `r` in 0, 1, ..., `sizeof...(slices)-1`,
`0 <= first[r] && first[r] < last[r] && last[r] <= src.extent(r)` is `true`.
* *Constraints:*
* For all types `T` in the parameter pack `SliceSpecifiers...`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add constraint: Input mdspan layout must be left, right, or stride. This is because some layouts (e.g., tiled) don't allow arbitrary subspans.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Implementation defined whether other layouts are supported" i.e., are a constraint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in P0009r8-more-math branch.

contiguous set of objects; e.g., restrict `T` to be trivially copyable or have a wider alignment.
An accessor policy defines
a type through which a single element is accessed,
a type through which the contiguous set of elements is accessed,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "through" mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"defines a generalization of pointer, which is a handle to the contiguous set of elements." (relax contiguity later, in a later paper, e.g., for segmented allocations)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"defines a reference, which is a handle to a single element"

@@ -1797,7 +1903,7 @@ Table �: Accessor policy requirements
<tr>
<td>`A::offset_policy`</td>
<td></td>
<td>Accessor policy which can access a pointer that has been return by `a.offset(p,i)`.</td>
<td>Accessor policy which can access a pointer that has been returned by `a.offset(p,i)`.</td>
</tr>
<tr>
<td>`a.decay(p)`</td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is another relaxation point, only required under certain circumstances; returns a span

@@ -1797,7 +1903,7 @@ Table �: Accessor policy requirements
<tr>
<td>`A::offset_policy`</td>
<td></td>
<td>Accessor policy which can access a pointer that has been return by `a.offset(p,i)`.</td>
<td>Accessor policy which can access a pointer that has been returned by `a.offset(p,i)`.</td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Accessor policy whose pointer typedef is convertible from a.offset(p,i)"

@mhoemmen
Copy link
Contributor Author

mhoemmen commented Oct 2, 2018

Per request by @crtrott, I will make another pass that turns most of the code in mdspan.subspan into math, and submit that as a separate pull request (but with all the other changes in this branch).

@mhoemmen
Copy link
Contributor Author

mhoemmen commented Oct 2, 2018

New PR is #77. I am in favor of closing this PR (#74) and focusing on #77.

@dhollman
Copy link
Collaborator

dhollman commented Oct 3, 2018

Agreed. Closing to avoid confusion.

@dhollman dhollman closed this Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants