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

ModStdQt ref_ff_rc regression fix #3405

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions experimental/ModStd/ModStdQt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@
function ref_ff_rc!(M::MatElem{<:MPolyRingElem})
rk = 0
for i=1:nrows(M)
c = content(M[i, :])
c = content(M[i:i, :])
if !isone(c)
M[i, :] = divexact(M[i, :], c)
M[i, :] = divexact(M[i:i, :], c)

Check warning on line 486 in experimental/ModStd/ModStdQt.jl

View check run for this annotation

Codecov / codecov/patch

experimental/ModStd/ModStdQt.jl#L486

Added line #L486 was not covered by tests
end
end
j = 1
Expand Down Expand Up @@ -524,8 +524,8 @@
continue
end
g, a, b = gcd_with_cofactors(M[k, j], M[i, j])
M[k, :] = b*M[k, :] - a * M[i, :]
M[k, :] = divexact(M[k, :], content(M[k, :]))
M[k, :] = b*M[k:k, :] - a * M[i:i, :]
M[k, :] = divexact(M[k:k, :], content(M[k:k, :]))
end
j += 1
end
Expand Down
7 changes: 7 additions & 0 deletions experimental/ModStd/test/ModStdQt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ end
f = factor_absolute(u^2+v^2*a)
@test length(f) == 2
end

@testset "Examples.ref_ff_rc!" begin
S, (a, b) = polynomial_ring(QQ, ["a", "b"]);
A = matrix(S, [a b; b a])
Oscar.ModStdQt.ref_ff_rc!(A)
@test A == matrix(S, [a b ; 0 1])
end
Loading