Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

isrimhook is incorrect?

Open kalmarek opened this issue 8 years ago • 6 comments

While working on my own code for YoungDiagrams I encountered this:

λ = [5,3,2,2,1]
μ = [2,2,1]

m, n = length(λ), length(μ)
l = maximum(λ)
youngdiagram=zeros(Int, m, l)
for i=1:n
    youngdiagram[i, μ[i]+1:λ[i]]=1
end
for i=n+1:m
    youngdiagram[i, 1:λ[i]]=1
end
youngdiagram

produces

5×5 Array{Int64,2}:
 0  0  1  1  1
 0  0  1  0  0
 0  1  0  0  0
 1  1  0  0  0
 1  0  0  0  0

which is clearly not a rimhook (it's disconnected). however Combinatorics.isrimhook((λ, μ)) returns true.

Am I missing something obvious?

kalmarek avatar Jul 09 '17 16:07 kalmarek

Looks like it checks for "having a neighbour" https://github.com/JuliaMath/Combinatorics.jl/blob/master/src/youngdiagrams.jl#L78 instead of connectedness, as in you example every cell has a neighbour but the diagram is not connected.

mschauer avatar Oct 16 '18 10:10 mschauer

https://github.com/Nemocas/AbstractAlgebra.jl/blob/b0bcc77ba64d97cd8a3c2e57b1bfe7cad20db5c0/src/generic/YoungTabs.jl#L860

kalmarek avatar Oct 16 '18 11:10 kalmarek

what license do you need to just copy my code?

kalmarek avatar Oct 16 '18 11:10 kalmarek

Can you check if there is something in https://github.com/JuliaMath/Combinatorics.jl/blob/master/src/youngdiagrams.jl which is not covered by your code? If would almost propose to remove it here and refer to https://github.com/Nemocas/AbstractAlgebra.jl for the functionality.

mschauer avatar Oct 16 '18 11:10 mschauer

Otherwise if you wrote the code in question, than you allow the use of the code under MIT for this package by saying so.

mschauer avatar Oct 16 '18 11:10 mschauer

You can use the code in YoungDiags under MIT license;

Looking very briefly, all of that is covered in AbstractAlgebra.jl

kalmarek avatar Oct 16 '18 11:10 kalmarek