1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-09-13 08:25:39 +02:00

Merge pull request #12 from kalmarek/fix/wlmetric_ball_serial

fix error in wlmetric_ball_serial
This commit is contained in:
kalmarek 2020-10-14 23:39:52 +02:00 committed by GitHub
commit a8a14206d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 30 deletions

View File

@ -5,10 +5,10 @@ os:
- osx - osx
julia: julia:
- 1.3 - 1.3
- 1.4 - 1.5
- nightly - nightly
notifications: notifications:
email: true email: false
matrix: matrix:
fast_finish: true fast_finish: true
allow_failures: allow_failures:

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright 2020 Marek Kaluba
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,22 +0,0 @@
The Groups.jl package is licensed under the MIT "Expat" License:
> Copyright (c) 2017: kalmar.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>

View File

@ -1,7 +1,7 @@
name = "Groups" name = "Groups"
uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557" uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557"
authors = ["Marek Kaluba <kalmar@amu.edu.pl>"] authors = ["Marek Kaluba <kalmar@amu.edu.pl>"]
version = "0.5.0" version = "0.5.1"
[deps] [deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"

View File

@ -72,7 +72,6 @@ word-length metric on the group generated by `S`. The ball is centered at `cente
(by default: the identity element). `radius` and `op` keywords specify the (by default: the identity element). `radius` and `op` keywords specify the
radius and multiplication operation to be used. radius and multiplication operation to be used.
""" """
function wlmetric_ball_serial( function wlmetric_ball_serial(
S::AbstractVector{T}; S::AbstractVector{T};
radius = 2, radius = 2,
@ -81,10 +80,7 @@ function wlmetric_ball_serial(
old = unique!([one(first(S)), S...]) old = unique!([one(first(S)), S...])
sizes = [1, length(old)] sizes = [1, length(old)]
for i = 2:radius for i = 2:radius
new = collect( new = collect(op(o, s) for o in @view(old[sizes[end-1]:end]) for s in S)
op(i, j)
for (i, j) in Base.product(@view(old[sizes[end-1]:end]), S)
)
append!(old, new) append!(old, new)
resize!(new, 0) resize!(new, 0)
old = unique!(old) old = unique!(old)

View File

@ -15,6 +15,8 @@ using LinearAlgebra
S = [w,r,s]; S = unique([S; inv.(S)]); S = [w,r,s]; S = unique([S; inv.(S)]);
_, sizes = Groups.wlmetric_ball(S, radius=4); _, sizes = Groups.wlmetric_ball(S, radius=4);
@test sizes == [7, 33, 141, 561] @test sizes == [7, 33, 141, 561]
_, sizes = Groups.wlmetric_ball_serial(S, radius=4);
@test sizes == [7, 33, 141, 561]
end end
include("FreeGroup-tests.jl") include("FreeGroup-tests.jl")