mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-04 18:11:26 +01:00
fix indentation
This commit is contained in:
parent
0ab4df2ce5
commit
1783ba5065
@ -82,7 +82,7 @@ elements(G::MltGrp{F}) where F <: AbstractAlgebra.GFField = (G(i*G.obj(1)) for i
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
doc"""
|
doc"""
|
||||||
DirectProductGroup(G::Group, n::Int) <: Group
|
DirectProductGroup(G::Group, n::Int) <: Group
|
||||||
Implements `n`-fold direct product of `G`. The group operation is
|
Implements `n`-fold direct product of `G`. The group operation is
|
||||||
`*` distributed component-wise, with component-wise identity as neutral element.
|
`*` distributed component-wise, with component-wise identity as neutral element.
|
||||||
"""
|
"""
|
||||||
@ -197,11 +197,11 @@ end
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function show(io::IO, G::DirectProductGroup)
|
function show(io::IO, G::DirectProductGroup)
|
||||||
println(io, "$(G.n)-fold direct product of $(G.group)")
|
print(io, "$(G.n)-fold direct product of $(G.group)")
|
||||||
end
|
end
|
||||||
|
|
||||||
function show(io::IO, g::DirectProductGroupElem)
|
function show(io::IO, g::DirectProductGroupElem)
|
||||||
print(io, "($(join(g.elts,",")))")
|
print(io, "[$(join(g.elts,","))]")
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -215,9 +215,9 @@ doc"""
|
|||||||
> Checks if two direct product groups are the same.
|
> Checks if two direct product groups are the same.
|
||||||
"""
|
"""
|
||||||
function (==)(G::DirectProductGroup, H::DirectProductGroup)
|
function (==)(G::DirectProductGroup, H::DirectProductGroup)
|
||||||
G.group == H.group || return false
|
G.group == H.group || return false
|
||||||
G.n == G.n || return false
|
G.n == G.n || return false
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
doc"""
|
doc"""
|
||||||
@ -225,8 +225,8 @@ doc"""
|
|||||||
> Checks if two direct product group elements are the same.
|
> Checks if two direct product group elements are the same.
|
||||||
"""
|
"""
|
||||||
function (==)(g::DirectProductGroupElem, h::DirectProductGroupElem)
|
function (==)(g::DirectProductGroupElem, h::DirectProductGroupElem)
|
||||||
g.elts == h.elts || return false
|
g.elts == h.elts || return false
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -269,9 +269,9 @@ doc"""
|
|||||||
# TODO: can Base.product handle generators?
|
# TODO: can Base.product handle generators?
|
||||||
# now it returns nothing's so we have to collect ellements...
|
# now it returns nothing's so we have to collect ellements...
|
||||||
function elements(G::DirectProductGroup)
|
function elements(G::DirectProductGroup)
|
||||||
elts = collect(elements(G.group))
|
elts = collect(elements(G.group))
|
||||||
cartesian_prod = Base.product([elts for _ in 1:G.n]...)
|
cartesian_prod = Base.product([elts for _ in 1:G.n]...)
|
||||||
return (DirectProductGroupElem([elt...]) for elt in cartesian_prod)
|
return (DirectProductGroupElem([elt...]) for elt in cartesian_prod)
|
||||||
end
|
end
|
||||||
|
|
||||||
doc"""
|
doc"""
|
||||||
|
Loading…
Reference in New Issue
Block a user