From 8b486cc709722cbb8b8de9049e8d4f545c6f2027 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 27 Sep 2024 19:45:25 +0200 Subject: [PATCH] Move QQMatrix(::ZZMatrix) constructor (#1868) --- src/HeckeMoreStuff.jl | 6 ------ src/flint/fmpq_mat.jl | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HeckeMoreStuff.jl b/src/HeckeMoreStuff.jl index d903631e8..ba714cae5 100644 --- a/src/HeckeMoreStuff.jl +++ b/src/HeckeMoreStuff.jl @@ -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 diff --git a/src/flint/fmpq_mat.jl b/src/flint/fmpq_mat.jl index 19f30d576..0c54f93c3 100644 --- a/src/flint/fmpq_mat.jl +++ b/src/flint/fmpq_mat.jl @@ -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