-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AbstractArray: fancy getindex and setindex! fallbacks
This implements "fancy" indexing behaviors for all AbstractArray subtypes. * Converts CartesianIndices to their full dimensionality, regardless of the types of any other indices * For linear fast arrays, computes the linear index from multidimensional scalars * For linear slow arrays, computes the full dimensionality indexing subscript from a linear index * Implements non-scalar indexing: * Logical indexing * Vectors or ranges of indices * Indexing with one multidimensional array of indices The non-scalar indexing relies heavily on `similar`, so a default implementation for AbstractArrays was created to return an Array. Additionally, this expands the usage of `Base.unsafe_getindex` for indexing without bounds checks.
- Loading branch information
Showing
7 changed files
with
432 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.