mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2025-01-04 20:30:29 +01:00
use @compat for types, etc
This commit is contained in:
parent
4bb3c9df4f
commit
02c1022846
@ -4,16 +4,16 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
immutable AutSymbol <: GSymbol
|
||||
@compat struct AutSymbol <: GSymbol
|
||||
str::String
|
||||
pow::Int
|
||||
ex::Expr
|
||||
func::Function
|
||||
end
|
||||
|
||||
typealias AutGroupElem GWord{AutSymbol}
|
||||
@compat AutGroupElem = GWord{AutSymbol}
|
||||
|
||||
type AutGroup <: AbstractFPGroup
|
||||
@compat mutable struct AutGroup <: AbstractFPGroup
|
||||
objectGroup::Group
|
||||
gens::Vector{AutSymbol}
|
||||
end
|
||||
|
@ -4,14 +4,14 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
immutable FPSymbol <: GSymbol
|
||||
@compat struct FPSymbol <: GSymbol
|
||||
str::String
|
||||
pow::Int
|
||||
end
|
||||
|
||||
typealias FPGroupElem = GWord{FPSymbol}
|
||||
@compat FPGroupElem = GWord{FPSymbol}
|
||||
|
||||
type FPGroup <: AbstractFPGroup
|
||||
@compat mutable struct FPGroup <: AbstractFPGroup
|
||||
gens::Vector{FPSymbol}
|
||||
rels::Dict{FPGroupElem, FPGroupElem}
|
||||
|
||||
|
@ -4,14 +4,14 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
immutable FreeSymbol <: GSymbol
|
||||
@compat struct FreeSymbol <: GSymbol
|
||||
str::String
|
||||
pow::Int
|
||||
end
|
||||
|
||||
typealias FreeGroupElem GWord{FreeSymbol}
|
||||
@compat FreeGroupElem = GWord{FreeSymbol}
|
||||
|
||||
type FreeGroup <: AbstractFPGroup
|
||||
@compat mutable struct FreeGroup <: AbstractFPGroup
|
||||
gens::Vector{FreeSymbol}
|
||||
# order::Vector{T}
|
||||
# fastmult_table::Array{Int,2}
|
||||
|
@ -1,4 +1,5 @@
|
||||
module Groups
|
||||
using Compat
|
||||
|
||||
using Nemo
|
||||
import Nemo: Group, GroupElem, Ring
|
||||
@ -24,7 +25,7 @@ doc"""
|
||||
> * `pow` which is the (multiplicative) exponent of a symbol.
|
||||
|
||||
"""
|
||||
abstract GSymbol
|
||||
abstract type GSymbol end
|
||||
|
||||
doc"""
|
||||
W::GWord{T<:GSymbol} <:GroupElem
|
||||
@ -42,7 +43,7 @@ doc"""
|
||||
|
||||
"""
|
||||
|
||||
type GWord{T<:GSymbol} <: GroupElem
|
||||
@compat mutable struct GWord{T<:GSymbol} <: GroupElem
|
||||
symbols::Vector{T}
|
||||
savedhash::UInt
|
||||
modified::Bool
|
||||
@ -78,11 +79,11 @@ convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s])
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
xor(a,b) = a $ b
|
||||
|
||||
function hash(W::GWord, h::UInt)
|
||||
W.modified && reduce!(W)
|
||||
return xor(W.savedhash, h)
|
||||
@compat res = xor(W.savedhash, h)
|
||||
return res
|
||||
end
|
||||
|
||||
function deepcopy_internal{T<:GSymbol}(W::GWord{T}, dict::ObjectIdDict)
|
||||
|
Loading…
Reference in New Issue
Block a user