faster versions of * and inv for products of rings
This commit is contained in:
parent
6f08259466
commit
6fa01d87ef
|
@ -170,7 +170,7 @@ function *{T<:RingElem}(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{
|
||||||
if check
|
if check
|
||||||
parent(g) == parent(h) || throw("Can not multiply elements of different groups!")
|
parent(g) == parent(h) || throw("Can not multiply elements of different groups!")
|
||||||
end
|
end
|
||||||
return DirectProductGroupElem([a+b for (a,b) in zip(g.elts,h.elts)])
|
return DirectProductGroupElem(g.elts + h.elts)
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -189,7 +189,7 @@ function inv{T<:GroupElem}(g::DirectProductGroupElem{T})
|
||||||
end
|
end
|
||||||
|
|
||||||
function inv{T<:RingElem}(g::DirectProductGroupElem{T})
|
function inv{T<:RingElem}(g::DirectProductGroupElem{T})
|
||||||
return DirectProductGroupElem([-a for a in g.elts])
|
return DirectProductGroupElem(-g.elts)
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
Loading…
Reference in New Issue