Open
Description
The following code comes from the abandoned oscar-system/Oscar.jl#4334, and can be used to convert a GroupAlgebraElem
(with sparse rep!) to a Dict{Group, elem_type(base_ring_type(...))
using Dict(x)
. I put this here in case someone wants to extend it for the dense rep and put it in the src.
function Base.length(x::GroupAlgebraElem)
@assert Hecke._is_sparse(x)
return length(x.coeffs_sparse)
end
function Base.iterate(x::GroupAlgebraElem)
@assert Hecke._is_sparse(x)
next = iterate(x.coeffs_sparse)
isnothing(next) && return nothing
(i, c), st = next
return (parent(x).base_to_group[i], c), st
end
function Base.iterate(x::GroupAlgebraElem, st)
@assert Hecke._is_sparse(x)
next = iterate(x.coeffs_sparse, st)
isnothing(next) && return nothing
(i, c), st = next
return (parent(x).base_to_group[i], c), st
end
Metadata
Metadata
Assignees
Labels
No labels