mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-27 01:10:28 +01:00
Make AutGroups into standalone module
This commit is contained in:
parent
cb47c62f5d
commit
5572b0c1ce
@ -3,10 +3,10 @@ module AutGroups
|
||||
using Groups
|
||||
using Permutations
|
||||
|
||||
import Base: inv
|
||||
import Base: inv, ^
|
||||
import Groups: IdSymbol, change_pow, GWord, ==, hash, reduce!
|
||||
|
||||
export IDSymbol, AutSymbol, AutWord
|
||||
export AutSymbol, AutWord, GWord
|
||||
export rmul_AutSymbol, lmul_AutSymbol, flip_AutSymbol, symmetric_AutSymbol
|
||||
|
||||
immutable AutSymbol <: GSymbol
|
||||
|
11
Groups.jl
11
Groups.jl
@ -1,11 +1,12 @@
|
||||
module Groups
|
||||
|
||||
export GSymbol, GWord
|
||||
export reduce!, reduce
|
||||
|
||||
import Base: length, ==, hash, show
|
||||
import Base: one, inv, reduce, *, ^
|
||||
|
||||
export GSymbol, GWord
|
||||
export reduce!, reduce
|
||||
|
||||
export IDSymbol, change_pow, reduce!, reduce
|
||||
|
||||
abstract GSymbol
|
||||
|
||||
@ -19,6 +20,8 @@ end
|
||||
|
||||
length(s::GSymbol) = (s.pow == 0 ? 0 : 1)
|
||||
|
||||
IDSymbol(T::Type{GSymbol}) = throw(ArgumentError("Define IDSymbol(::Type{$T}) which is the identity element for Your type!"))
|
||||
|
||||
one{T<:GSymbol}(::Type{T}) = IDSymbol(T)
|
||||
one(s::GSymbol) = one(typeof(s))
|
||||
|
||||
@ -154,7 +157,7 @@ r_multiply(W::GWord, x; reduced::Bool=true) =
|
||||
l_multiply(W::GWord, x; reduced::Bool=true) =
|
||||
l_multiply!(deepcopy(W),x, reduced=reduced)
|
||||
|
||||
(*){T}(W::GWord{T}, Z::GWord{T}) = FreeGroups.r_multiply(W, Z.symbols)
|
||||
(*){T}(W::GWord{T}, Z::GWord{T}) = r_multiply(W, Z.symbols)
|
||||
(*)(W::GWord, s::GSymbol) = W*GWord(s)
|
||||
(*)(s::GSymbol, W::GWord) = GWord(s)*W
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user