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

Added docs for the StridedArrays and fixed a doctest fail #28144

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jul 16, 2018

I wasn't removing the file in that base/file doctest I wrote and it was bad. Now it is fixed. Also more docs for the Strided* types. Sorry for the bad branch name.

@kshyatt kshyatt added docs This change adds or pertains to documentation arrays [a, r, r, a, y, s] labels Jul 16, 2018
@kshyatt kshyatt requested a review from mbauman July 16, 2018 21:17
@kshyatt
Copy link
Contributor Author

kshyatt commented Jul 18, 2018

Review pls?

"""
StridedArray{T, N}

An `N` dimensional *strided* array with elements of type `T`. A strided array may *not* be contiguous
Copy link
Member

Choose a reason for hiding this comment

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

How about s/may/might? "May not" sounds like it must not be contiguous.

I think it'd be good to introduce what strides are first. This is a little tricky. Here's one shot:

A union of common builtin N-dimensional array types with elements of type T that follow the strided array interface

If A isa StridedArray, then its entries are stored in memory with fixed offsets (or "strides") such that incrementing an index along dimension d jumps ahead in memory by strides(A, d) slots. Strided arrays are particularly important because they can sometimes be passed directly as pointers to foreign language libraries like BLAS.

Also note that strides of 1 isn't sufficient for contiguousness. The condition is: strides(A, 1) == 1 && strides(A)[2:end] == size(A)[1:end-1], but I don't think we need to talk about contiguousness here.

@kshyatt
Copy link
Contributor Author

kshyatt commented Aug 1, 2018

Finally got around to updating this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants