Skip to content

Commit

Permalink
Add some missing context parameters in fmpz_mod_mat
Browse files Browse the repository at this point in the history
  • Loading branch information
albinahlback committed Apr 24, 2024
1 parent 80cb078 commit a73c80e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/flint/fmpz_mod_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function setindex!(a::ZZModMatrix, b::ZZModMatrix, r::UnitRange{Int64}, c::UnitR
size(b) == (length(r), length(c)) || throw(DimensionMismatch("tried to assign a $(size(b, 1))x$(size(b, 2)) matrix to a $(length(r))x$(length(c)) destination"))
A = view(a, r, c)
ccall((:fmpz_mod_mat_set, libflint), Nothing,
(Ref{ZZModMatrix}, Ref{ZZModMatrix}), A, b)
(Ref{ZZModMatrix}, Ref{ZZModMatrix}, Ref{Nothing}), A, b, C_NULL) # ctx not used
end

function deepcopy_internal(a::ZZModMatrix, dict::IdDict)
Expand Down Expand Up @@ -535,7 +535,7 @@ function Solve._can_solve_internal_no_check(A::ZZModMatrix, b::ZZModMatrix, task
x = similar(A, ncols(A), ncols(b))
# This is probably only correct if the characteristic is prime
fl = ccall((:fmpz_mod_mat_can_solve, libflint), Cint,
(Ref{ZZModMatrix}, Ref{ZZModMatrix}, Ref{ZZModMatrix}), x, A, b)
(Ref{ZZModMatrix}, Ref{ZZModMatrix}, Ref{ZZModMatrix}, Ref{fmpz_mod_ctx_struct}), x, A, b, base_ring(x).ninv)
if task === :only_check || task === :with_solution
return Bool(fl), x, zero(A, 0, 0)
end
Expand Down Expand Up @@ -992,7 +992,7 @@ function nullspace(M::ZZModMatrix)
# Apparently this only works correctly if base_ring(M) is a field
N = similar(M, ncols(M), ncols(M))
nullity = ccall((:fmpz_mod_mat_nullspace, libflint), Int,
(Ref{ZZModMatrix}, Ref{ZZModMatrix}), N, M)
(Ref{ZZModMatrix}, Ref{ZZModMatrix}, Ref{fmpz_mod_ctx_struct}), N, M, base_ring(N).ninv)
return nullity, view(N, 1:nrows(N), 1:nullity)
end

Expand Down

0 comments on commit a73c80e

Please sign in to comment.