-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add missing matrix multiplication methods involving OneElement #347
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #347 +/- ##
==========================================
+ Coverage 99.89% 99.90% +0.01%
==========================================
Files 8 8
Lines 934 1037 +103
==========================================
+ Hits 933 1036 +103
Misses 1 1 ☔ View full report in Codecov by Sentry. |
This PR should hit 100% code coverage. |
The codecov upload errored, e.g. in https://github.com/JuliaArrays/FillArrays.jl/actions/runs/7740101659/job/21104345601?pr=347. I think running the tests again might lead to more accurate results. |
if iszero(getindex_value(x)) | ||
mul!(y, A, Zeros{eltype(x)}(axes(x)), alpha, beta) | ||
return y | ||
end |
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.
I am dubious as to if this check is worth the potential type instability.
I feel like such a OneElement where that element is also zero is almost never constructed.
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.
It's not type-unstable, though. It just calls a different method that returns the same vector, and should be type-stable as well. This is a guard against the current implementation allowing the indices to not lie within the axes (which probably should be disallowed).
E.g.:
julia> @report_opt mul!(zeros(2), ones(2,2), OneElement(1,2))
No errors detected
if iszero(getindex_value(B)) | ||
mul!(C, A, Zeros{eltype(B)}(axes(B)), alpha, beta) | ||
return C | ||
end |
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.
per above I am dubious
Co-authored-by: Frames White <[email protected]>
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.
I am assume because the tests pass and this has 100% coverage that it is correct
This adds several missing methods, so