Skip to content

Commit

Permalink
Remove many calls to *cat(::Vector{...}) (#1253)
Browse files Browse the repository at this point in the history
* Remove many calls to `hcat(::Vector{...})`

* Remove many calls to `vcat(::Vector{...})`
  • Loading branch information
lgoettgens authored Oct 20, 2023
1 parent e7306f5 commit 5140ace
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 48 deletions.
16 changes: 8 additions & 8 deletions examples/Klueners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function s3_extensions(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
wild = [1*zk]
for (P, e) = l3
b = floor(Int, 3//2*(1+e))
wild = vcat([[P^i * x for x = wild] for i=1:b]...)
wild = reduce(vcat, [[P^i * x for x = wild] for i=1:b])
end
sort!(wild, lt = (a,b) -> norm(a) <= norm(b))

Expand Down Expand Up @@ -282,12 +282,12 @@ function s3_extensions(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
return
end

m2, map2 = sub(R.M, vcat([lift(mat(x[2])) for x = i2]), !false)
m2, map2 = sub(R.M, reduce(vcat, [lift(mat(x[2])) for x = i2]), !false)
sub_m2 = Hecke.stable_subgroups(m2, [GrpAbFinGenMap(map2*x*pseudo_inv(map2)) for x = R.ac], quotype = [3, 3], op = (R, x) -> sub(R, x, !false))
m1 = []
target_ind = 0
for (k,v) = ii
m, mp = sub(R.M, vcat([lift(mat(i1[x][2])) for x = v]))
m, mp = sub(R.M, reduce(vcat, [lift(mat(i1[x][2])) for x = v]))
push!(m1, mp)
if target == k
target_ind = length(m1)
Expand All @@ -302,7 +302,7 @@ function s3_extensions(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
if length(m1) == 1
rest = sub(R.M, [R.M[0]])
else
rest = sub(R.M, vcat([matrix(m1[j]) for j=1:length(m1) if i != j]), !false)
rest = sub(R.M, reduce(vcat, [matrix(m1[j]) for j=1:length(m1) if i != j]), !false)
end
for s = sub_m2
rr = rest[1]+map2(s[2](s[1])[1])[1]
Expand Down Expand Up @@ -534,7 +534,7 @@ function s3_extensions2(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
wild = [1*zk]
for (P, e) = l3
b = floor(Int, 3//2*(1+e))
wild = vcat([[P^i * x for x = wild] for i=1:b]...)
wild = reduce(vcat, [[P^i * x for x = wild] for i=1:b])
end
sort!(wild, lt = (a,b) -> norm(a) <= norm(b))
_wild = sort(collect(Set(minimum(x) for x = wild)))
Expand Down Expand Up @@ -589,12 +589,12 @@ function s3_extensions2(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
return
end

m2, map2 = sub(R.M, vcat([lift(mat(x[2])) for x = i2]), !false)
m2, map2 = sub(R.M, reduce(vcat, [lift(mat(x[2])) for x = i2]), !false)
sub_m2 = Hecke.stable_subgroups(m2, [GrpAbFinGenMap(map2*x*pseudo_inv(map2)) for x = R.ac], quotype = [3, 3], op = (R, x) -> sub(R, x, !false))
m1 = []
target_ind = 0
for (k,v) = ii
m, mp = sub(R.M, vcat([lift(mat(i1[x][2])) for x = v]))
m, mp = sub(R.M, reduce(vcat, [lift(mat(i1[x][2])) for x = v]))
push!(m1, mp)
if target == k
target_ind = length(m1)
Expand All @@ -609,7 +609,7 @@ function s3_extensions2(k::AnticNumberField, d::ZZRingElem, _T::Int = 0)
if length(m1) == 1
rest = sub(R.M, [R.M[0]])
else
rest = sub(R.M, vcat([matrix(m1[j]) for j=1:length(m1) if i != j]), !false)
rest = sub(R.M, reduce(vcat, [matrix(m1[j]) for j=1:length(m1) if i != j]), !false)
end
for s = sub_m2
rr = rest[1]+map2(s[2](s[1])[1])[1]
Expand Down
2 changes: 1 addition & 1 deletion examples/MultiQuad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function multi_quad_with_emb(d::Vector{ZZRingElem})
for i=1:div(length(lp), 2)
K, m1, m2 = compositum(lp[2*i-1], lp[2*i])
push!(ld, K)
push!(lau, vcat([ m1(x) for x = aut[2*i-1]], [ m2(x) for x = aut[2*i]]))
push!(lau, vcat([m1(x) for x = aut[2*i-1]], [m2(x) for x = aut[2*i]]))
end
if isodd(length(lp))
push!(ld, lp[end])
Expand Down
2 changes: 1 addition & 1 deletion examples/Round2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function ring_of_multipliers(O::Order, I::MatElem)
II, d = pseudo_inv(I)
@assert II*I == d
# return II, d, [representation_matrix(O(vec(collect(I[i, :])))) for i=1:nrows(I)]
m = hcat([divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)]...)
m = reduce(hcat, [divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)])
m = m'
n = degree(O)
mm = hnf(m[1:n, 1:n])
Expand Down
8 changes: 4 additions & 4 deletions examples/polymake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ function norm_equation2_fac_elem(R::NfAbsOrd, k::ZZRingElem; abs::Bool = false)
@assert Hecke.is_maximal(R)
lp = factor(k*R)
s, ms = Hecke.sunit_mod_units_group_fac_elem(collect(keys(lp)))
C = vcat([matrix(FlintZZ, 1, ngens(s), [valuation(ms(s[i]), p) for i=1:ngens(s)]) for p = keys(lp)])
C = reduce(vcat, [matrix(FlintZZ, 1, ngens(s), [valuation(ms(s[i]), p) for i=1:ngens(s)]) for p = keys(lp)])

lp = factor(k)
A = vcat([matrix(FlintZZ, 1, ngens(s), [valuation(Hecke.factored_norm(ms(s[i])), p) for i=1:ngens(s)]) for p = keys(lp.fac)])
A = reduce(vcat, [matrix(FlintZZ, 1, ngens(s), [valuation(Hecke.factored_norm(ms(s[i])), p) for i=1:ngens(s)]) for p = keys(lp.fac)])
b = matrix(FlintZZ, length(lp.fac), 1, [valuation(k, p) for p = keys(lp.fac)])

so = solve_mixed(A, b, C)
Expand Down Expand Up @@ -225,9 +225,9 @@ function norm_equation_fac_elem(R::Hecke.NfRelOrd{nf_elem,Hecke.NfOrdFracIdl}, a
q, mms = snf(q)
mq = mq*inv(mms)

C = vcat([matrix(FlintZZ, 1, ngens(q), [valuation(mS(preimage(mq, q[i])), p) for i=1:ngens(q)]) for p = keys(lp)])
C = reduce(vcat, [matrix(FlintZZ, 1, ngens(q), [valuation(mS(preimage(mq, q[i])), p) for i=1:ngens(q)]) for p = keys(lp)])

A = vcat([matrix(FlintZZ, 1, ngens(q), [valuation(norm(mkK, mS(preimage(mq, g))), p) for g in gens(q)]) for p = keys(la)])
A = reduce(vcat, [matrix(FlintZZ, 1, ngens(q), [valuation(norm(mkK, mS(preimage(mq, g))), p) for g in gens(q)]) for p = keys(la)])
b = matrix(FlintZZ, length(la), 1, [valuation(a, p) for p = keys(la)])

so = solve_mixed(A, b, C)
Expand Down
2 changes: 1 addition & 1 deletion src/AlgAssAbsOrd/LocallyFreeClassGroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ function image(m::DiscLogLocallyFreeClassGroup, I::AlgAssAbsOrdIdl)

# Put the components together and map it to C
G = codomain(mR.into_product_of_groups)
r = mR.into_product_of_groups\(GrpAbFinGenElem(G, hcat([ e.coeff for e in elts_in_R ])))
r = mR.into_product_of_groups \ (GrpAbFinGenElem(G, reduce(hcat, [e.coeff for e in elts_in_R])))
c += RtoC(r)
end
return c
Expand Down
4 changes: 2 additions & 2 deletions src/GenOrd/GenOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function ring_of_multipliers(O::GenOrd, I::MatElem{T}, p::T, is_prime::Bool = fa
II, d = pseudo_inv(I)
@assert II*I == d

m = hcat([divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)]...)
m = reduce(hcat, [divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)])
m = transpose(m)
if is_prime
x = residue_field(parent(p), p)
Expand Down Expand Up @@ -534,7 +534,7 @@ function ring_of_multipliers(O::GenOrd, I::MatElem)
II, d = pseudo_inv(I)
@assert II*I == d

m = hcat([divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)]...)
m = reduce(hcat, [divexact(representation_matrix(O(vec(collect(I[i, :]))))*II, d) for i=1:nrows(I)])
m = transpose(m)
n = degree(O)
mm = hnf(m[1:n, 1:n])
Expand Down
4 changes: 2 additions & 2 deletions src/GenOrd/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function assure_has_basis_matrix(A::GenOrdIdl)

@hassert :NfOrd 1 has_2_elem(A)

V = hnf(vcat([representation_matrix(x) for x in [O(A.gen_one),A.gen_two]]),:lowerleft)
V = hnf(reduce(vcat, [representation_matrix(x) for x in [O(A.gen_one),A.gen_two]]),:lowerleft)
d = ncols(V)
A.basis_matrix = V[d+1:2*d,1:d]
return nothing
Expand Down Expand Up @@ -272,7 +272,7 @@ function Base.:(*)(a::GenOrdIdl, b::GenOrdIdl)
O = order(a)
Ma = basis_matrix(a)
Mb = basis_matrix(b)
V = hnf(vcat([Mb*representation_matrix(O([Ma[i,o] for o in 1:ncols(Ma)])) for i in 1:ncols(Ma)]),:lowerleft)
V = hnf(reduce(vcat, [Mb*representation_matrix(O([Ma[i,o] for o in 1:ncols(Ma)])) for i in 1:ncols(Ma)]),:lowerleft)
d = ncols(V)
return GenOrdIdl(O, V[d*(d-1)+1:d^2,1:d])
end
Expand Down
2 changes: 1 addition & 1 deletion src/GenOrd/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ end
function GenOrdIdl(O::GenOrd, T::Vector{<:GenOrdElem})
@assert all(x -> parent(x) === O, T)
# One should do this block by block instead of the big matrix
V = hnf(vcat([representation_matrix(O) for x in T]), :lowerleft)
V = hnf(reduce(vcat, [representation_matrix(O) for x in T]), :lowerleft)
d = ncols(V)
n = length(T)
return GenOrdIdl(O, V[((n - 1)*d + 1):(n*d), :])
Expand Down
8 changes: 4 additions & 4 deletions src/GrpAb/GrpAbFinGen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ function matrix(M::Map{GrpAbFinGen, GrpAbFinGen})
return M.map
end
G = domain(M)
return vcat([M(g).coeff for g = gens(G)])
return reduce(vcat, [M(g).coeff for g = gens(G)])
end

function matrix(M::Generic.IdentityMap{GrpAbFinGen})
Expand Down Expand Up @@ -814,7 +814,7 @@ function hom(G::GrpAbFinGen, H::GrpAbFinGen, A::Matrix{ <: Map{GrpAbFinGen, GrpA
error("both groups need to be direct products")
end
@assert all(i -> domain(A[i[1], i[2]]) == dG[i[1]] && codomain(A[i[1], i[2]]) == dH[i[2]], Base.Iterators.ProductIterator((1:r, 1:c)))
h = hom(G, H, vcat([hcat([matrix(A[i,j]) for j=1:c]) for i=1:r]))
h = hom(G, H, reduce(vcat, [reduce(hcat, [matrix(A[i,j]) for j=1:c]) for i=1:r]))
return h
end

Expand All @@ -823,15 +823,15 @@ function _flat(G::GrpAbFinGen)
if s === nothing
return [G]
end
return vcat([_flat(x) for x = s]...)
return reduce(vcat, [_flat(x) for x = s])
end

function _tensor_flat(G::GrpAbFinGen)
s = get_attribute(G, :tensor_product)
if s === nothing
return [G]
end
return vcat([_tensor_flat(x) for x = s]...)
return reduce(vcat, [_tensor_flat(x) for x = s])
end


Expand Down
12 changes: 6 additions & 6 deletions src/GrpAb/Map.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ function haspreimage(M::GrpAbFinGenMap, a::Vector{GrpAbFinGenElem})
isdefined(H, :exponent) && G.exponent == H.exponent
e = G.exponent
RR = Native.GF(Int(e))
fl, p = can_solve_with_solution(map_entries(RR, m), map_entries(RR, vcat([x.coeff for x = a])), side = :left)
fl, p = can_solve_with_solution(map_entries(RR, m), map_entries(RR, reduce(vcat, [x.coeff for x = a])), side = :left)
p = map_entries(x -> lift(x), p)
else
fl, p = can_solve_with_solution(m, vcat([x.coeff for x = a]), side = :left)
fl, p = can_solve_with_solution(m, reduce(vcat, [x.coeff for x = a]), side = :left)
end

if fl
Expand Down Expand Up @@ -159,7 +159,7 @@ function hom(A::Vector{GrpAbFinGenElem}, B::Vector{GrpAbFinGenElem}; check::Bool
return hom(GA, GB, matrix(FlintZZ, ngens(GA), 0, ZZRingElem[]), check = check)
end

M = vcat([hcat(A[i].coeff, B[i].coeff) for i = 1:length(A)])
M = reduce(vcat, [hcat(A[i].coeff, B[i].coeff) for i = 1:length(A)])
RA = rels(GA)
M = vcat(M, hcat(RA, zero_matrix(FlintZZ, nrows(RA), ncols(B[1].coeff))))
if isdefined(GB, :exponent) && nrows(M) >= ncols(M)
Expand All @@ -180,7 +180,7 @@ Creates the homomorphism which maps $G[i]$ to $B[i]$.
function hom(G::GrpAbFinGen, B::Vector{GrpAbFinGenElem}; check::Bool = true)
GB = parent(B[1])
@assert length(B) == ngens(G)
M = vcat([B[i].coeff for i = 1:length(B)])
M = reduce(vcat, [B[i].coeff for i = 1:length(B)])
h = hom(G, GB, M, check = check)
return h
end
Expand All @@ -191,7 +191,7 @@ function hom(G::GrpAbFinGen, H::GrpAbFinGen, B::Vector{GrpAbFinGenElem}; check::
if length(B) == 0
M = zero_matrix(ZZ, ngens(G), ngens(H))
else
M = vcat([x.coeff for x = B]...)
M = reduce(vcat, [x.coeff for x = B])
end
#=
M = zero_matrix(FlintZZ, ngens(G), ngens(H))
Expand Down Expand Up @@ -620,7 +620,7 @@ function hom(G::GrpAbFinGen, H::GrpAbFinGen; task::Symbol = :map)
if ngens(sG) == 0
return R[0]
end
local mm = transpose(vcat([preimage(mH, r(mG(sG[i]))).coeff for i = 1:ngens(sG)]))
local mm = transpose(reduce(vcat, [preimage(mH, r(mG(sG[i]))).coeff for i = 1:ngens(sG)]))
return R([divexact(mm[j,i], c[(i-1)*m+j]) for i=1:n for j=1:m])
end
return R, MapFromFunc(R, MapParent(G, H, "homomorphisms"), phi, ihp)
Expand Down
6 changes: 3 additions & 3 deletions src/GrpAb/stable_sub.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function maximal_submodules(M::ZpnGModule, ind::Int=-1)
end
mH = Hecke.GrpAbFinGenMap(S.V,K,A)
sg, msg = kernel(mH)
push!(list, vcat([ (mS(msg(y))).coeff for y in gens(sg)]))
push!(list, reduce(vcat, [(mS(msg(y))).coeff for y in gens(sg)]))
end
return list

Expand Down Expand Up @@ -762,7 +762,7 @@ function submodules_order(M::ZpnGModule, ord::Int)

MatSnf=map(mS.map, R)
for j=1:length(list)
list[j]=list[j]*MatSnf #vcat([W(( mS( S.V([list[j][k,i].data for i=1:ngens(S.V)]))).coeff) for k=1:nrows(list[j])])
list[j]=list[j]*MatSnf #reduce(vcat, [W(( mS( S.V([list[j][k,i].data for i=1:ngens(S.V)]))).coeff) for k=1:nrows(list[j])])
end

#
Expand All @@ -771,7 +771,7 @@ function submodules_order(M::ZpnGModule, ord::Int)

minlist=minimal_submodules(N,ord, lf)
for x in minlist
push!(list, vcat([W((mS( S.V(ZZRingElem[FlintZZ(coeff(x[k,i],0))*((M.p)^(v[i]-1)) for i=1:ngens(S.V)]))).coeff) for k=1:nrows(x) ]))
push!(list, reduce(vcat, [W((mS( S.V(ZZRingElem[FlintZZ(coeff(x[k,i],0))*((M.p)^(v[i]-1)) for i=1:ngens(S.V)]))).coeff) for k=1:nrows(x) ]))
end
return (x for x in list)

Expand Down
8 changes: 4 additions & 4 deletions src/LocalField/neq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ end
function coordinates(a::Union{qadic, LocalFieldElem}, k)
c = [coeff(a, i) for i=0:degree(parent(a))-1]
while absolute_degree(parent(c[1])) > absolute_degree(k)
c = vcat([[coeff(x, i) for i=0:(degree(parent(c[1]))-1)] for x = c]...)
c = reduce(vcat, [[coeff(x, i) for i=0:(degree(parent(c[1]))-1)] for x = c])
end
if parent(c[1]) != k
if isa(parent(c[1]), FlintQadicField) && degree(parent(c[1])) ==1
Expand Down Expand Up @@ -300,7 +300,7 @@ function solve_1_units(a::Vector{T}, b::T) where T
end

expo += s.coeff * expo_mult
expo_mult = vcat([_mk(x).coeff for x = gens(_k)]...)*expo_mult
expo_mult = reduce(vcat, [_mk(x).coeff for x = gens(_k)])*expo_mult
cur_a = [prod(cur_a[i]^_mk(x)[i] for i=1:length(cur_a)) for x = gens(_k)]
# @show [e*valuation(x-1) for x = cur_a]

Expand Down Expand Up @@ -562,8 +562,8 @@ struct MapEvalCtx
mat = matrix(prime_field(domain(M)),
absolute_degree(domain(M)),
absolute_degree(codomain(M)),
vcat([absolute_coordinates(M(x))
for x = absolute_basis(domain(M))]...))
reduce(vcat, [absolute_coordinates(M(x))
for x = absolute_basis(domain(M))]))

return new(domain(M), codomain(M), mat)
end
Expand Down
2 changes: 1 addition & 1 deletion src/Map/GrpAb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ mutable struct GrpAbFinGenMap <: Map{GrpAbFinGen, GrpAbFinGen,
if ngens(D) == 0
r.map = matrix(FlintZZ, 0, ngens(codomain(M)), ZZRingElem[])
else
r.map = vcat([M(D[i]).coeff for i=1:ngens(D)])
r.map = reduce(vcat, [M(D[i]).coeff for i=1:ngens(D)])
end
return r
end
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ end

function roots(R::AcbField, f::Union{ZZPolyRingElem, QQPolyRingElem}, abs_tol::Int=R.prec, initial_prec::Int...)
lf = factor(f)
return map(R, vcat([_roots(g, abs_tol, initial_prec...) for g = keys(lf.fac) if degree(g) > 0]...))
return map(R, reduce(vcat, [_roots(g, abs_tol, initial_prec...) for g = keys(lf.fac) if degree(g) > 0]))
end

function _roots(f::QQPolyRingElem, ::PosInf; prec::Int=64)
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/PseudoPolynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function _contains(a::nf_elem, I)
d = lcm(dena, lcm([denominator(id) for id in I]))
v = matrix(FlintZZ, 1, degree(OK), coordinates(OK(d * a)))
@assert all(isone(denominator(basis_matrix(d * id))) for id in I)
M = vcat([numerator(basis_matrix(d * id)) for id in I ])
M = reduce(vcat, [numerator(basis_matrix(d * id)) for id in I ])
b, w = cansolve(M', v')
@assert b
res = nf_elem[]
Expand Down
2 changes: 1 addition & 1 deletion src/NumField/NfAbs/MPolyAbsFact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function symbolic_roots(f::ZZMPolyRingElem, r::ZZRingElem, pr::Int = 10; max_roo
g = evaluate(f, [Hecke.Globals.Zx(r), gen(Hecke.Globals.Zx)])
@assert is_squarefree(g)
lg = factor(g)
rt = vcat([Hecke.roots(number_field(x)[1], x) for x = keys(lg.fac)]...)
rt = reduce(vcat, [Hecke.roots(number_field(x)[1], x) for x = keys(lg.fac)])
rt = rt[1:min(length(rt), max_roots)]
RT = []
for i = 1:length(rt)
Expand Down
12 changes: 6 additions & 6 deletions src/NumFieldOrd/NfOrd/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1639,14 +1639,14 @@ function vcat(P::PMat, Q::PMat)
end

function vcat(A::Vector{ <: PMat })
m = vcat([ P.matrix for P in A ])
c = vcat([ P.coeffs for P in A ]...)
m = reduce(vcat, [P.matrix for P in A])
c = reduce(vcat, [P.coeffs for P in A])
return pseudo_matrix(m, c)
end

function vcat(A::PMat...)
m = vcat([ P.matrix for P in A ])
c = vcat([ P.coeffs for P in A ]...)
m = reduce(vcat, [P.matrix for P in A])
c = reduce(vcat, [P.coeffs for P in A])
return pseudo_matrix(m, c)
end

Expand All @@ -1659,13 +1659,13 @@ end

function hcat(A::Vector{ <: PMat })
@assert all( P -> P.coeffs == A[1].coeffs, A)
m = hcat([ P.matrix for P in A ])
m = reduce(hcat, [P.matrix for P in A])
return pseudo_matrix(m, A[1].coeffs)
end

function hcat(A::PMat...)
@assert all( P -> P.coeffs == A[1].coeffs, A)
m = hcat([ P.matrix for P in A ])
m = reduce(hcat, [P.matrix for P in A])
return pseudo_matrix(m, A[1].coeffs)
end

Expand Down
2 changes: 1 addition & 1 deletion src/NumFieldOrd/NfOrd/norm_eqn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function is_norm(K::AnticNumberField, a::ZZRingElem; extra::Vector{ZZRingElem}=Z
#@assert norm(evaluate(x)) == evaluate(image(mu, h[end]))
end
s, ms = sub(u, h)
mp = GrpAbFinGenMap(U, u, vcat([x.coeff for x=h]))
mp = GrpAbFinGenMap(U, u, reduce(vcat, [x.coeff for x=h]))

fl, p = haspreimage(mp, preimage(mu, a))
if fl
Expand Down

0 comments on commit 5140ace

Please sign in to comment.