-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve complexity of getindex
#31
Conversation
getindex
Codecov Report
@@ Coverage Diff @@
## master #31 +/- ##
==========================================
+ Coverage 71.84% 73.21% +1.36%
==========================================
Files 4 3 -1
Lines 103 112 +9
==========================================
+ Hits 74 82 +8
- Misses 29 30 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to understand: previously the string would iterate over all the indexes, which would each construct a full Matrix, and then return the value. Now, instead of constructing the full matrix, we just construct the right element.
This seems sensible, and I wonder whether it takes roughly the same time as string(Matrix(woodbury))
?
Previously,
getindex
constructed the full dense matrix. This gets expensive, as it is used when e.g. forming a string representation of the array.Now we compute only the part that is necessary.
Closes #30