mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-09-05 14:46:44 +02:00
modify reverse_dict to allow generator arg
e.g. reverse_dict(elements(G))
This commit is contained in:
parent
e18e90ddaf
commit
bef0b67af6
@ -338,8 +338,9 @@ function rationalize{T<:Integer, S<:Number}(::Type{T}, X::GroupRingElem{S};
|
||||
return GroupRingElem(v, parent(X))
|
||||
end
|
||||
|
||||
function reverse_dict(a::AbstractVector)
|
||||
return Dict{eltype(a), Int}(x => i for (i,x) in enumerate(a))
|
||||
function reverse_dict(iter)
|
||||
T = eltype(iter)
|
||||
return Dict{T, Int}(x => i for (i,x) in enumerate(iter))
|
||||
end
|
||||
|
||||
function create_pm{T<:GroupElem}(basis::Vector{T}, basis_dict::Dict{T, Int},
|
||||
|
Loading…
Reference in New Issue
Block a user