From 9a4038e2da88c582867e96eb1961be50ef2ad4bd Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 27 Jul 2018 00:23:19 +0200 Subject: [PATCH] migrate to AbstractAlgebra --- src/GroupRings.jl | 14 +++++++------- test/runtests.jl | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 0cdb447..54e8719 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -1,8 +1,8 @@ __precompile__() module GroupRings -using Nemo -import Nemo: Group, GroupElem, Ring, RingElem, parent, elem_type, parent_type, mul!, addeq!, divexact +using AbstractAlgebra +import AbstractAlgebra: Group, GroupElem, Ring, RingElem, parent, elem_type, parent_type, mul!, addeq!, divexact import Base: convert, show, hash, ==, +, -, *, //, /, length, norm, rationalize, deepcopy_internal, getindex, setindex!, eltype, one, zero @@ -119,7 +119,7 @@ end zero(RG::GroupRing, T::Type=Int) = RG(T) one(RG::GroupRing, T::Type=Int) = RG(RG.group(), T) -one(RG::GroupRing{R}, T::Type=Int) where {R<:Nemo.Ring} = RG(one(RG.group()), T) +one(RG::GroupRing{R}, T::Type=Int) where {R<:Ring} = RG(one(RG.group()), T) function (RG::GroupRing)(i::Int, T::Type=Int) elt = RG(T) @@ -153,7 +153,7 @@ function (RG::GroupRing){T<:Number}(x::AbstractVector{T}) return result end -function (RG::GroupRing{Gr,T}){Gr<:Nemo.Group, T<:Nemo.GroupElem}(V::Vector{T}, +function (RG::GroupRing{Gr,T}){Gr<:Group, T<:GroupElem}(V::Vector{T}, S::Type=Rational{Int}; alt=false) res = RG(S) for g in V @@ -295,8 +295,8 @@ end (*)(a, X::GroupRingElem) = mul(a,X) (*)(X::GroupRingElem, a) = mul(a,X) -# disallow Nemo.Rings to hijack *(::, ::GroupRingElem) -*(a::Union{AbstractFloat, Integer, Nemo.RingElem, Rational}, X::GroupRingElem) = mul(a,X) +# disallow Rings to hijack *(::, ::GroupRingElem) +*(a::Union{AbstractFloat, Integer, RingElem, Rational}, X::GroupRingElem) = mul(a,X) (/)(X::GroupRingElem, a) = 1/a*X @@ -526,7 +526,7 @@ function reverse_dict(::Type{I}, iter) where I<:Integer return Dict{eltype(iter), I}(x => i for (i,x) in enumerate(iter)) end -reverse_dict(iter) = reverse_dict(UInt, iter) +reverse_dict(iter) = reverse_dict(Int, iter) function create_pm{T<:GroupElem}(basis::Vector{T}, basis_dict::Dict{T, Int}, limit::Int=length(basis); twisted::Bool=false, check=true) diff --git a/test/runtests.jl b/test/runtests.jl index 2878b58..af704a6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,13 +1,13 @@ -using GroupRings using Base.Test -using Nemo +using AbstractAlgebra +using GroupRings @testset "GroupRings" begin @testset "Constructors: PermutationGroup" begin G = PermutationGroup(3) - @test isa(GroupRing(G), Nemo.Ring) + @test isa(GroupRing(G), AbstractAlgebra.Ring) @test isa(GroupRing(G), GroupRing) RG = GroupRing(G)