mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-11-10 12:20:27 +01:00
reverse_dict function for fast basis element lookup
This commit is contained in:
parent
d13a8b27df
commit
70817a8fbc
@ -191,6 +191,8 @@ 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))
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user