diff --git a/src/Nemo.jl b/src/Nemo.jl index 5bac688e84..08f432ea92 100644 --- a/src/Nemo.jl +++ b/src/Nemo.jl @@ -165,6 +165,8 @@ include("arb/ArbTypes.jl") include("pari/PariTypes.jl") +include("ambiguities.jl") # remove ambiguity warnings + include("Groups.jl") ########################################################### diff --git a/src/ambiguities.jl b/src/ambiguities.jl new file mode 100644 index 0000000000..ba1fabe243 --- /dev/null +++ b/src/ambiguities.jl @@ -0,0 +1,101 @@ +# Fix ambiguities on julia 0.4 + +*(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) * b) + +*(a::fmpz, b::ResElem{fmpz}) = b*a + ++(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) + b) + ++(a::fmpz, b::ResElem{fmpz}) = b + a + +-(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) - b) + +-(a::fmpz, b::ResElem{fmpz}) = parent(b)(a - data(b)) + +function ==(a::ResElem{fmpz}, b::fmpz) + z = base_ring(a)(b) + return data(a) == mod(z, modulus(a)) +end + +==(a::fmpz, b::ResElem{fmpz}) = b == a + +# + +*(::fmpz, ::PolyElem{fmpz}) = nothing + +*(::PolyElem{fmpz}, ::fmpz) = nothing + ++(::fmpz, ::PolyElem{fmpz}) = nothing + ++(::PolyElem{fmpz}, ::fmpz) = nothing + +-(::fmpz, ::PolyElem{fmpz}) = nothing + +-(::PolyElem{fmpz}, ::fmpz) = nothing + +==(::fmpz, ::PolyElem{fmpz}) = nothing + +==(::PolyElem{fmpz}, ::fmpz) = nothing + +divexact(::PolyElem{fmpz}, ::fmpz) = nothing + +evaluate(::PolyElem{fmpz}, ::fmpz) = nothing + +# + +*(::fmpz, ::SeriesElem{fmpz}) = nothing + +*(::SeriesElem{fmpz}, ::fmpz) = nothing + ++(::fmpz, ::SeriesElem{fmpz}) = nothing + ++(::SeriesElem{fmpz}, ::fmpz) = nothing + +-(::fmpz, ::SeriesElem{fmpz}) = nothing + +-(::SeriesElem{fmpz}, ::fmpz) = nothing + +==(::fmpz, ::SeriesElem{fmpz}) = nothing + +==(::SeriesElem{fmpz}, ::fmpz) = nothing + +*(::fmpz, ::MatElem{fmpz}) = nothing + +*(::MatElem{fmpz}, ::fmpz) = nothing + ++(::fmpz, ::MatElem{fmpz}) = nothing + ++(::MatElem{fmpz}, ::fmpz) = nothing + +-(::fmpz, ::MatElem{fmpz}) = nothing + +-(::MatElem{fmpz}, ::fmpz) = nothing + +==(::MatElem{fmpz}, ::fmpz) = nothing + +divexact(::MatElem{fmpz}, ::fmpz) = nothing + +# + +setindex_t!(a::nmod_mat, b::GenRes{fmpz}, i::Int, j::Int) = setindex_!(a, data(b), i, j) + +*(::FracElem{fmpz}, ::fmpz) = nothing + +*(::fmpz, ::FracElem{fmpz}) = nothing + ++(::FracElem{fmpz}, ::fmpz) = nothing + ++(::fmpz, ::FracElem{fmpz}) = nothing + +-(::FracElem{fmpz}, ::fmpz) = nothing + +-(::fmpz, ::FracElem{fmpz}) = nothing + +==(::FracElem{fmpz}, ::fmpz) = nothing + +==(::fmpz, ::FracElem{fmpz}) = nothing + +divexact(::FracElem{fmpz}, ::fmpz) = nothing + +divexact(::fmpz, ::FracElem{fmpz}) = nothing + diff --git a/src/flint/fmpz_rel_series.jl b/src/flint/fmpz_rel_series.jl index 4e3da85766..1fccd13035 100644 --- a/src/flint/fmpz_rel_series.jl +++ b/src/flint/fmpz_rel_series.jl @@ -215,6 +215,8 @@ function *(x::Int, y::fmpz_rel_series) return z end +*(x::fmpz_rel_series, y::Int) = y * x + function *(x::fmpz, y::fmpz_rel_series) z = parent(y)() z.prec = y.prec @@ -224,6 +226,8 @@ function *(x::fmpz, y::fmpz_rel_series) return z end +*(x::fmpz_rel_series, y::fmpz) = y * x + ############################################################################### # # Shifting diff --git a/src/generic/RelSeries.jl b/src/generic/RelSeries.jl index 426b7ae8aa..3269ba2562 100644 --- a/src/generic/RelSeries.jl +++ b/src/generic/RelSeries.jl @@ -450,7 +450,7 @@ doc""" *{T <: RingElem}(a::SeriesElem{T}, b::T) > Return $a\times b$. """ -*{T <: RingElem}(a::SeriesElem, b::T) = b*a +*{T <: RingElem}(a::SeriesElem{T}, b::T) = b*a doc""" *{T <: RingElem}(a::SeriesElem{T}, b::Integer)