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

More lin alg #2021

Merged
merged 11 commits into from
Feb 12, 2025
Merged

More lin alg #2021

merged 11 commits into from
Feb 12, 2025

Conversation

fieker
Copy link
Contributor

@fieker fieker commented Feb 7, 2025

No description provided.

started ZZMatrix-linalg with
  - is_unimodular
  - dixon/ solve/ init
  - DoublePlusOne solver
added some ZZ/ZZMatrix functions
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 84.44790% with 100 lines in your changes missing coverage. Please review.

Project coverage is 88.27%. Comparing base (7f1f323) to head (27a930e).
Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
src/ZZMatrix-linalg.jl 83.94% 100 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2021      +/-   ##
==========================================
- Coverage   88.36%   88.27%   -0.10%     
==========================================
  Files          98      100       +2     
  Lines       36233    36727     +494     
==========================================
+ Hits        32016    32419     +403     
- Misses       4217     4308      +91     

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

function zero!(z::ZZMatrixOrPtr)
@ccall libflint.fmpz_mat_zero(z::Ref{ZZMatrix})::Nothing
return z
end

function zero_row!(z::ZZMatrix, i::Int)
z_ptr = mat_entry_ptr(z, i, 1)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever z begin .... block

@@ -1828,6 +1841,15 @@ function sub!(z::ZZMatrixOrPtr, x::ZZMatrixOrPtr, y::ZZMatrixOrPtr)
return z
end

function sub!(A::ZZMatrix, B::ZZMatrix, m::Int)
for i=1:nrows(A)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever A B begin .... block

bN = ZZRingElem(Val(:raw))
bD = ZZRingElem(Val(:raw))
D = ZZRingElem(1)
for i=1:nrows(a)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever a A begin .... block

if ncols(_B) == 1
n = nrows(D.A)
for i=1:n
Ay_ptr = mat_entry_ptr(D.Ay, i, 1)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever D.Ay begin .... block or something like that

# R = zero_matrix(ZZ, 1, ncols(U))
zero!(R)
while true
R_ptr = Nemo.mat_entry_ptr(R, 1, 1)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever R U begin .... block

function add_into!(A::ZZMatrix, C::ZZMatrix, c::Int)
A.r = max(A.r, C.r+c)
for i=1:nrows(C)
A_ptr = Nemo.mat_entry_ptr(A, i+c, 1)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever A C begin .... block

function sub_into!(A::ZZMatrix, C::ZZMatrix, c::Int)
A.r = max(A.r, C.r+c)
for i=1:nrows(C)
A_ptr = Nemo.mat_entry_ptr(A, i+c, 1)
Copy link
Member

Choose a reason for hiding this comment

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

needs a GC.@presever A C begin .... block

end
i += 1
end
return U
Copy link
Member

Choose a reason for hiding this comment

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

Also

Nemo._fmpz_clear_fn(t)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well spotted! Yes!

src/flint/fmpz_mat.jl Outdated Show resolved Hide resolved
@fieker fieker merged commit f215cb3 into master Feb 12, 2025
22 of 24 checks passed
@fieker fieker deleted the MoreLinAlg branch February 12, 2025 08:07
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