-
Notifications
You must be signed in to change notification settings - Fork 57
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
Implement efficient sparse array comparisons #227
Conversation
Codecov Report
@@ Coverage Diff @@
## main #227 +/- ##
==========================================
+ Coverage 92.11% 92.15% +0.03%
==========================================
Files 11 11
Lines 7203 7223 +20
==========================================
+ Hits 6635 6656 +21
+ Misses 568 567 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: Sobhan Mohammadpour <[email protected]>
Is there a need to check |
|
@SobhanMP Yes, that needs to be checked, since e.g. |
@Wimmerer yes but are all zeros equal? |
Co-authored-by: Sobhan Mohammadpour <[email protected]>
B = Counting.(B) | ||
As = Any[A, A', transpose(A)] | ||
Bs = Any[B, B', transpose(B)] | ||
for A′ in As, B′ in Bs |
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.
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.
Saved by the colour coding?
so i compared the number of operations with flattened arrays and it seems that this patch does less comparison than sparse sparse comparison. let me check a few things tonight. otherwise looks good. |
If all good, then please merge. |
in the end i think it's best to not compare zero, for the sake of compability with @ViralBShah do you know how it would be possible to make a benchmark for this package. to track performance degradations? |
I think we should compare the zeros: julia> fill(0,1,1) == fill([0;;],1,1)
false
julia> sparse(fill(0,1,1)) == sparse(fill([0;;],1,1))
true That's a bug in the current sparse array comparisons. |
Opened #234 for the issue above. |
i'll go ahead an merge this, if any one has any opinion, i guess we can move to #234 |
Closes #226.