Skip to content

Commit

Permalink
Move QQMatrix(::ZZMatrix) constructor (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Sep 27, 2024
1 parent 7894c21 commit 8b486cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/HeckeMoreStuff.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
function QQMatrix(x::ZZMatrix)
z = zero_matrix(QQ, nrows(x), ncols(x))
ccall((:fmpq_mat_set_fmpz_mat, libflint), Nothing, (Ref{QQMatrix}, Ref{ZZMatrix}), z, x)
return z
end

function round(::Type{Int}, a::QQFieldElem)
return round(Int, Rational{BigInt}(a))
end
Expand Down
6 changes: 6 additions & 0 deletions src/flint/fmpq_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,12 @@ function matrix(R::QQField, r::Int, c::Int, arr::AbstractVector{Rational{T}}) wh
return z
end

function QQMatrix(x::ZZMatrix)
z = QQMatrix(nrows(x), ncols(x))
@ccall libflint.fmpq_mat_set_fmpz_mat(z::Ref{QQMatrix}, x::Ref{ZZMatrix})::Nothing
return z
end

###############################################################################
#
# Zero matrix
Expand Down

0 comments on commit 8b486cc

Please sign in to comment.