Skip to content
Snippets Groups Projects
Commit a196fb01 authored by Adrien Poteaux's avatar Adrien Poteaux
Browse files

Few typos in Hensel + normalising Laurent polynomials when truncating them (saves a lot of time \!)

parent 575dda39
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,9 @@ end
function _valuated_hensel(P::R,fac::Vector{Pair{Fpol,Int}},n::V,phi_pow_inv::Vector{R2},vals::Vector{V},e::Vector{Int},f::Vector{Int},Lambda::Tuple{F2,F2},Cinv::Vector{Generic.MatSpaceElem{Rational{Int}}}) where {R<:PolyRingElem,Fpol<:PolyRingElem,V,F,R2<:Tuple{Vector{R},Vector{R}},F2<:Vector{F}}
# Getting 2 factors from fac
l = length(fac)
if (l == 1) && (degree(R) == degree(P)) return [P] end
if (l == 1) && (degree(fac[1][1])*fac[1][2]*degree(phi_pow_inv[end][1][1]) == degree(P)) return [P] end
if (l == 1) # there is an infinite factor to deal with
g, h = R, parent(P)(1)
g, h = R, parent(P)[1]
else
k = div(l,2,RoundUp)
g = prod([fac[i][1]^fac[i][2] for i in 1:k])
......
......@@ -84,12 +84,12 @@ function phi_pow_and_inv(phi::PolyRingElem, d::Int)
i = 1
while i<n
i*=2
inv = truncate(2*inv-rev(a)*inv^2,i)
inv = truncate(2*inv-rev(a)*inv^2,i)# TODO ne mettre a jour que la partie haute ?
end
phi_pow_inv = [phi_pow_inv;truncate(inv,n)] # truncating with precision n so that the next degrees fit perfectly
else # using previous computations (each time, a is the square of the previous a) ; we only need to double the precision once !
inv = phi_pow_inv[end]^2 # correct modulo x^(n/2) [n/2 is the previous n since we compute succesive squares for phi_pow]
inv = truncate(2*inv-rev(a)*inv^2,n)
inv = truncate(2*inv-rev(a)*inv^2,n)# TODO ne mettre a jour que la partie haute ?
phi_pow_inv = [phi_pow_inv;inv]
end
end
......
......@@ -206,8 +206,8 @@ end
# In: w the aimed valuation, vals the valuation of the key polynomials, e and f the partial ramification indices and residual degrees of the type, M the list of inverse matrices of the sequence of value groups (first element being the one of the base field), s>0 the "level" of the type we are considering
# Out: a list of tuple (v, exps) where exps give the exponents of the key polynomials and v the valuation of the base_ring element.
function all_monomials_given_valuation(w::V,vals::Vector{V},e::Vector{Int},f::Vector{Int},Cinv::Vector{Generic.MatSpaceElem{Rational{Int}}},s::Int) where V
a = OMFactorisation.gamma_cofactors_given_inverse_matrix(Cinv[s],w) # the aimed valuation expressed as a vector
b = OMFactorisation.gamma_cofactors_given_inverse_matrix(Cinv[s],vals[s]) # same for the current valuation
a = gamma_cofactors_given_inverse_matrix(Cinv[s],w) # the aimed valuation expressed as a vector
b = gamma_cofactors_given_inverse_matrix(Cinv[s],vals[s]) # same for the current valuation
i = 0
res = Tuple{V,Vector{Int}}[]
while lcm(map(denominator,a-i*b)) != 1
......
......@@ -48,7 +48,11 @@ end
function OMFactorisation.:base_truncation(elt::LaurentPolyRingElem,n::Rational{Int})
t = gen(parent(elt))
return truncate(elt.poly,Int(ceil(n)-elt.mindeg))*t^elt.mindeg
v = OMFactorisation.valuation(elt)
if v == infinity return t-t end# t-t has mindeg 0
# we first make mindeg minimal to avoid unnecessary 0
P = shift_right(elt.poly,v-elt.mindeg)*t^v
return truncate(P.poly,Int(ceil(n)-P.mindeg))*t^P.mindeg
end
# In : A basis and an element of the residue field
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment