Skip to content

Commit

Permalink
Improve testing of Young diagram code
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahao committed Nov 7, 2015
1 parent 5cfbd4e commit d1b6872
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/youngdiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function leglength(ξ::SkewDiagram)
λ, μ = ξ
m, n = length(λ), length(μ)
#Construct matrix representation of diagram
if m==0 return -1 end
l = maximum(λ)
youngdiagram=zeros(Int, m, l)
for i=1:n
Expand Down
12 changes: 9 additions & 3 deletions test/youngdiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ using Combinatorics
using Base.Test

@test ([5,4,2,2]\[2,1]) == ([5, 4, 2, 2],[2, 1])

@test leglength([5,4,2,2], [2,1]) == leglength(([5, 4, 2, 2],[2, 1])) == 3
@test leglength([1], [1]) == -1
@test leglength(Int[], Int[]) == -1

@test isrimhook([4,3,2], [2,2,2])
@test !isrimhook([4,3,2], [2,2,1])
@test !isrimhook([4,3,2], [1,1])
λ = [5,4,2,1]
@test partitionsequence(λ) == [1, 0, 1, 0, 1, 1, 0, 1, 0]
@test character(λ, [4,3,2,2,1]) == 0

let λ = [5,4,2,1]
@test partitionsequence(λ) == [1, 0, 1, 0, 1, 1, 0, 1, 0]
@test character(λ, [4,3,2,2,1]) == 0
end
@test character([1], [1]) == 1

0 comments on commit d1b6872

Please sign in to comment.