1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-29 11:00:28 +01:00

remove rationalize

This commit is contained in:
kalmarek 2018-08-13 20:47:54 +02:00
parent b81fb881ae
commit 0180856083

View File

@ -4,7 +4,7 @@ module GroupRings
using AbstractAlgebra using AbstractAlgebra
import AbstractAlgebra: Group, GroupElem, Ring, RingElem, parent, elem_type, parent_type, mul!, addeq!, divexact 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 import Base: convert, show, hash, ==, +, -, *, //, /, length, norm, deepcopy_internal, getindex, setindex!, eltype, one, zero
############################################################################### ###############################################################################
# #
@ -494,16 +494,6 @@ aug(X::GroupRingElem) = sum(X.coeffs)
supp(X::GroupRingElem) = parent(X).basis[findn(X.coeffs)] supp(X::GroupRingElem) = parent(X).basis[findn(X.coeffs)]
function rationalize{T<:Integer, S<:Integer}(::Type{T}, X::GroupRingElem{S})
return convert(Rational{T}, X)
end
function rationalize{T<:Integer, S<:Number}(::Type{T}, X::GroupRingElem{S};
tol=eps(S))
v = rationalize(T, X.coeffs, tol=tol)
return GroupRingElem(v, parent(X))
end
function reverse_dict(::Type{I}, iter) where I<:Integer function reverse_dict(::Type{I}, iter) where I<:Integer
length(iter) > typemax(I) && error("Can not produce reverse dict: $(length(iter)) is too large for $T") length(iter) > typemax(I) && error("Can not produce reverse dict: $(length(iter)) is too large for $T")
return Dict{eltype(iter), I}(x => i for (i,x) in enumerate(iter)) return Dict{eltype(iter), I}(x => i for (i,x) in enumerate(iter))