Skip to content

Commit

Permalink
Remove some trace methods (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Sep 24, 2024
1 parent 8ce122a commit cfdfcfa
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 67 deletions.
4 changes: 2 additions & 2 deletions src/flint/fmpz_mod_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ function tr(a::T) where T <: Zmod_fmpz_mat
r = ZZRingElem()
ccall((:fmpz_mod_mat_trace, libflint), Nothing,
(Ref{ZZRingElem}, Ref{T}, Ref{fmpz_mod_ctx_struct}),
r, a, base_ring(a).ninv)
return ZZModRingElem(r, R)
r, a, R.ninv)
return elem_type(R)(r, R)
end

################################################################################
Expand Down
16 changes: 0 additions & 16 deletions src/flint/fq_default_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -377,22 +377,6 @@ function rref!(a::FqMatrix)
return r
end

#################################################################################
#
# Trace
#
#################################################################################

function tr(a::FqMatrix)
!is_square(a) && error("Non-square matrix")
n = nrows(a)
t = zero(base_ring(a))
for i in 1:nrows(a)
add!(t, t, a[i, i])
end
return t
end

################################################################################
#
# Determinant
Expand Down
16 changes: 0 additions & 16 deletions src/flint/fq_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,6 @@ function rref!(a::FqPolyRepMatrix)
return r
end

#################################################################################
#
# Trace
#
#################################################################################

function tr(a::FqPolyRepMatrix)
!is_square(a) && error("Non-square matrix")
n = nrows(a)
t = zero(base_ring(a))
for i in 1:nrows(a)
add!(t, t, a[i, i])
end
return t
end

################################################################################
#
# Determinant
Expand Down
16 changes: 0 additions & 16 deletions src/flint/fq_nmod_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -357,22 +357,6 @@ function rref!(a::fqPolyRepMatrix)
return r
end

#################################################################################
#
# Trace
#
#################################################################################

function tr(a::fqPolyRepMatrix)
!is_square(a) && error("Non-square matrix")
n = nrows(a)
t = zero(base_ring(a))
for i in 1:nrows(a)
add!(t, t, a[i, i])
end
return t
end

################################################################################
#
# Determinant
Expand Down
17 changes: 0 additions & 17 deletions src/flint/gfp_fmpz_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,23 +154,6 @@ function Generic.add_one!(a::FpMatrix, i::Int, j::Int)
return a
end

################################################################################
#
# Trace
#
################################################################################

function tr(a::FpMatrix)
!is_square(a) && error("Matrix must be a square matrix")
R = base_ring(a)
r = ZZRingElem()
ccall((:fmpz_mod_mat_trace, libflint), Nothing,
(Ref{ZZRingElem}, Ref{FpMatrix}, Ref{fmpz_mod_ctx_struct}),
r, a, base_ring(a).ninv)
return FpFieldElem(r, R)
end


################################################################################
#
# Windowing
Expand Down

0 comments on commit cfdfcfa

Please sign in to comment.