1
0
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:
Marek Kaluba 2021-05-24 01:40:54 +02:00
parent 1c971cb3b1
commit 0fb84a9c61
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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