Skip to content
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

Don't use ccalls where wrappers already exist (fmpz edition) #1913

Merged
merged 19 commits into from
Oct 25, 2024

Conversation

lgoettgens
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 96.61017% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.39%. Comparing base (2a54dbe) to head (b152b34).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/flint/fmpz.jl 96.87% 1 Missing ⚠️
src/flint/fmpz_mat.jl 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1913      +/-   ##
==========================================
+ Coverage   87.22%   87.39%   +0.17%     
==========================================
  Files          97       97              
  Lines       35556    35539      -17     
==========================================
+ Hits        31014    31061      +47     
+ Misses       4542     4478      -64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -158,8 +158,7 @@ end
@boundscheck _checkbounds(A, i, j)
GC.@preserve A begin
m = mat_entry_ptr(A, i, j)
fl = ccall((:fmpz_sgn, libflint), Int, (Ptr{ZZRingElem},), m)
return isone(fl)
return is_positive(m)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code not covered, seems we have zero tests for is_positive_entry :-(

nr = ccall((:fmpq_numerator_ptr, libflint), Ptr{ZZRingElem}, (Ref{QQFieldElem},), a)
vn = ccall((:fmpz_remove, libflint), Clong, (Ptr{ZZRingElem}, Ptr{ZZRingElem}, Ref{ZZRingElem}), nr, nr, b)
nr = _num_ptr(a)
vn, nr = remove!(nr, b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code not covered, seems we have zero tests for remove! :-(

@fingolfin
Copy link
Member

I added a bunch of minor tests :-)

@fingolfin fingolfin enabled auto-merge (squash) October 25, 2024 00:21
@fingolfin fingolfin merged commit 246a850 into Nemocas:master Oct 25, 2024
24 checks passed
@lgoettgens lgoettgens deleted the lg/less-ccalls-fmpz branch October 25, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants