-
Notifications
You must be signed in to change notification settings - Fork 59
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
Clean up *_mat_entry_set
calls
#1910
Conversation
b69c2a8
to
0909192
Compare
a, i - 1, j - 1, u, base_ring(a)) | ||
@ccall libflint.fq_mat_entry_set( | ||
a::Ref{FqPolyRepMatrix}, (i-1)::Int, (j-1)::Int, u::Ref{FqPolyRepFieldElem}, base_ring(a)::Ref{FqPolyRepField} | ||
)::Nothing | ||
end | ||
|
||
@inline function setindex!(a::FqPolyRepMatrix, u::ZZRingElem, i::Int, j::Int) |
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.
for this function, I would like to make use of set!
from #1908 (instead of the ccall).
The problem is that the set!
implemented there needs to access parent
of the first arg, so it does not work with pointers there. What do you think about adding a third argument to set!
that defaults to parent(first_arg)
(for non-pointers), but in this particular case we can just pass base_ring(a)
Just to point this out, this won't happen in this PR.
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.
yeah, makes sense. Should the parent be a thread argument, though, or maybe a kwarg (that would make it easier to grep, harder to get confused about?)
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.
what do you mean by thread argument
?
And the way that I understand how kwargs work in julia, a call always involves a NamedTuple construction and another call (to the kwcall
) function. This may have an overhead that we do not want to have in something low-level as setindex!
.
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 vote for making it a normal positional argument.
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.
sorry, typo/braino, I meant "third argument"
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1910 +/- ##
==========================================
+ Coverage 87.24% 87.38% +0.14%
==========================================
Files 97 97
Lines 35590 35491 -99
==========================================
- Hits 31049 31014 -35
+ Misses 4541 4477 -64 ☔ View full report in Codecov by Sentry. |
I only added |
c4d9c73
to
d9943c1
Compare
Use the already installed
setindex!
methods with@inbounds
instead of ccalls everywhere