mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
add a few @inbounds
This commit is contained in:
parent
1c971cb3b1
commit
0fb84a9c61
@ -106,7 +106,7 @@ function evaluate!(
|
|||||||
) where {T<:FPGroupElement,N}
|
) where {T<:FPGroupElement,N}
|
||||||
A = alphabet(f)
|
A = alphabet(f)
|
||||||
for idx in word(f)
|
for idx in word(f)
|
||||||
t = evaluate!(t, A[idx], alphabet(object(parent(f))))::NTuple{N,T}
|
t = @inbounds evaluate!(t, A[idx], alphabet(object(parent(f))))::NTuple{N,T}
|
||||||
end
|
end
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
@ -49,7 +49,7 @@ Base.:(==)(t::Transvection, s::Transvection) =
|
|||||||
t.id === s.id && t.ij == s.ij && t.inv == s.inv
|
t.id === s.id && t.ij == s.ij && t.inv == s.inv
|
||||||
Base.hash(t::Transvection, h::UInt) = hash(t.id, hash(t.ij, hash(t.inv, h)))
|
Base.hash(t::Transvection, h::UInt) = hash(t.id, hash(t.ij, hash(t.inv, h)))
|
||||||
|
|
||||||
function evaluate!(v::Tuple, t::Transvection, A::Alphabet)
|
Base.@propagate_inbounds function evaluate!(v::Tuple, t::Transvection, A::Alphabet)
|
||||||
i, j = indices(t)
|
i, j = indices(t)
|
||||||
@assert i ≤ length(v) && j ≤ length(v)
|
@assert i ≤ length(v) && j ≤ length(v)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ word_type(::Type{<:AbstractFPGroup}) = Word{UInt8}
|
|||||||
# the default (results in free rewriting)
|
# the default (results in free rewriting)
|
||||||
rewriting(G::AbstractFPGroup) = alphabet(G)
|
rewriting(G::AbstractFPGroup) = alphabet(G)
|
||||||
|
|
||||||
function (G::AbstractFPGroup)(word::AbstractVector{<:Integer})
|
Base.@propagate_inbounds function (G::AbstractFPGroup)(word::AbstractVector{<:Integer})
|
||||||
@boundscheck @assert all(l -> 1 <= l <= length(KnuthBendix.alphabet(G)), word)
|
@boundscheck @assert all(l -> 1 <= l <= length(KnuthBendix.alphabet(G)), word)
|
||||||
return FPGroupElement(word_type(G)(word), G)
|
return FPGroupElement(word_type(G)(word), G)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user