jverzani / PolynomialFactors.jl

Julia code for factorization of polynomials over the integers
Other
7 stars 6 forks source link

Bug in factor(x^4-10*x^2+1) #13

Closed thofma closed 5 years ago

thofma commented 5 years ago

This example from the tests fail if repeated very often:

julia> using PolynomialFactors;
julia> using AbstractAlgebra;
julia> R, x = ZZ["x"];
julia> P = PolynomialFactors;
julia> for i in 1:1000; S2 = x^4 - 10*x^2 + 1; U = P.poly_factor(S2); @assert U[S2] == 1; end
ERROR: KeyError: key x^4-10*x^2+1 not found
Stacktrace:
 [1] getindex(::Dict{AbstractAlgebra.Generic.Poly{BigInt},Int64}, ::AbstractAlgebra.Generic.Poly{BigInt}) at ./dict.jl:478
 [2] top-level scope at ./REPL[14]:2 [inlined]
 [3] top-level scope at ./none:0
jverzani commented 5 years ago

Thanks for reporting this. I'll have a look. If I recall there is a certain randomness in the underlying factorization that may be the source here, though perhaps it is just poor coding on my part.

jverzani commented 5 years ago

Closing hoping this was addressed. Please reopen if it isn’t.