1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-07-12 01:35:30 +02:00

fix setindex!

This commit is contained in:
kalmar 2017-07-23 03:24:05 +02:00
parent aad2907c51
commit 251fdd4afa

View File

@ -48,8 +48,9 @@ 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
parent(v) == parent(first(g.elts)) || throw("$g is not an element of $i-th factor of $(parent(G))")
g.elts[i] = v
return g
end
###############################################################################