mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-04 18:11:26 +01:00
AbstractVector interface for DirectProductGroupElem
This commit is contained in:
parent
799878ded5
commit
a3eeee0728
@ -36,12 +36,24 @@ parent(g::DirectProductGroupElem) = DirectProductGroup([parent(h) for h in g.elt
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# DirectProductGroup / DirectProductGroupElem constructors
|
# AbstractVector interface
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
Base.size(g::DirectProductGroupElem) = size(g.elts)
|
||||||
|
Base.linearindexing(::Type{DirectProductGroupElem}) = Base.LinearFast()
|
||||||
|
Base.getindex(g::DirectProductGroupElem, i::Int) = g.elts[i]
|
||||||
|
function Base.setindex!{T<:GroupElem}(g::DirectProductGroupElem{T}, v::T, i::Int)
|
||||||
|
p.part[i] = v
|
||||||
|
return p
|
||||||
end
|
end
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
# DirectProductGroup / DirectProductGroupElem constructors
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
DirectProductGroup{T<:Group}(G::T, H::T) = DirectProductGroup{T}([G, H])
|
DirectProductGroup{T<:Group}(G::T, H::T) = DirectProductGroup{T}([G, H])
|
||||||
|
|
||||||
×(G::Group, H::Group) = DirectProductGroup([G,H])
|
×(G::Group, H::Group) = DirectProductGroup([G,H])
|
||||||
|
Loading…
Reference in New Issue
Block a user