-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple problems with views-of-views
Due to what was probably a copy/paste error, the tests were grabbing a global variable A (rather than an argument) that happened to be a plain array. So we weren't really testing views-of-views. Unsurprisingly, fixing this problem uncovered bugs. Many "simple" things worked, but sufficiently complicated constructs like A = rand(20, 20, 20) B = slice(A, 1:5, 6, 6:9) C = sub(B, :) (specifically, those that use linear indexing in creation of a view-of-view) certainly had problems. Drat. Well, hopefully this has been rare up until now; it seems rather likely that folks would have gotten BoundsErrors if anyone had actually been using this. But we start returning views from getindex it will become common, so better that it was caught now. In debugging and fixing the problems, I took the opportunity to do some cleanup to make this more maintainable, specifically: adopting a consistent naming convention, improving many variable names, and adding comments.
- Loading branch information
Showing
3 changed files
with
228 additions
and
142 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.