Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix factor #1639

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Hecke.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ using Pkg

import AbstractAlgebra
import AbstractAlgebra: get_cached!, @alias
import AbstractAlgebra: xxgcd, make_exact
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import AbstractAlgebra: xxgcd, make_exact

These don't seem to exist

┌ Hecke
│  WARNING: could not import AbstractAlgebra.xxgcd into Hecke
│  WARNING: could not import AbstractAlgebra.make_exact into Hecke
└ 

and are not needed for this fix?


import AbstractAlgebra: pretty, Lowercase, LowercaseOff, Indent, Dedent, terse, is_terse

Expand Down
2 changes: 1 addition & 1 deletion src/NumField/NfAbs/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ function cld_bound(f::PolyRingElem{AbsSimpleNumFieldElem}, k::Vector{Int})
g = Zx()
n = degree(base_ring(f))
for i=0:degree(f)
setcoeff!(g, i, Hecke.upper_bound(ZZRingElem, sqrt(t2(coeff(f, i))//n)))
setcoeff!(g, i, Hecke.upper_bound(ZZRingElem, sqrt(t2(coeff(f, i)))))
end
if is_monic(f)
setcoeff!(g, degree(f), ZZRingElem(1))
Expand Down
5 changes: 3 additions & 2 deletions src/NumField/NfAbs/PolyFact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ function van_hoeij(f::PolyRingElem{AbsSimpleNumFieldElem}, P::AbsNumFieldOrderId
_, mK = residue_field(order(P), P)
mK = extend(mK, K)
r = length(factor(map_coefficients(mK, f, cached = false)))
prec_scale = max(r, prec_scale)
N = degree(f)
@vprintln :PolyFactor 1 "Having $r local factors for degree $N"

Expand Down Expand Up @@ -589,7 +590,7 @@ function van_hoeij(f::PolyRingElem{AbsSimpleNumFieldElem}, P::AbsNumFieldOrderId
- the bounds are monotonous in the abs value of the coeffs (I think they are using abs value of coeff)
- the math works for real coeffs as well
- thus create an ZZPolyRingElem with pos. coeffs. containing upper bounds of the conjugates of the
coeffs. DOne via T_2: sqrt(n*T_2(alpha) is an upper bounds for all conjugates
coeffs. Done via T_2: sqrt(T_2(alpha) is an upper bounds for all conjugates
- Fieker/ Friedrichs compares T_2 vs 2-norm (squared) of coeffs
- leading coeff as well as den are algebraic
CHECK: den*lead*cld in Z[alpha] (or in the order used)
Expand All @@ -603,7 +604,7 @@ function van_hoeij(f::PolyRingElem{AbsSimpleNumFieldElem}, P::AbsNumFieldOrderId
# 2nd block is for additional bits for rounding?
bb = landau_mignotte_bound(f)*upper_bound(ZZRingElem, sqrt(t2(den*leading_coefficient(f))))
#CHECK: landau... is a bound on the (abs value) of the coeffs of the factors,
# need everywhere sqrt(n*T_2)? to get conjugate bounds
# need everywhere sqrt(T_2)? to get conjugate bounds
kk = ceil(Int, degree(K)/2/log(norm(P))*(log2(c1*c2) + 2*nbits(bb)))
@vprintln :PolyFactor 2 "using CLD precision bounds $b"

Expand Down
Loading