Skip to content

Commit e533608

Browse files
committed
Rename types to use CamelCase
1 parent da404fa commit e533608

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/youngdiagrams.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# Young diagrams, partitions of unity and characters of the symmetric group Sn #
33
################################################################################
44

5-
typealias partition Vector{Int64}
6-
typealias youngdiagram Array{Int64,2}
7-
typealias skewdiagram (partition, partition)
5+
typealias Partition Vector{Int64}
6+
typealias YoungDiagram Array{Int64,2}
7+
typealias SkewDiagram (Partition, Partition)
88

9-
export partition,
10-
youngdiagram, #represents shape of Young diagram
11-
skewdiagram, #skew diagrams
9+
export Partition,
10+
YoungDiagram, #represents shape of Young diagram
11+
SkewDiagram, #skew diagrams
1212
partitionsequence,
1313
isrimhook, #Check if skew diagram is rim hook
1414
leglength,
@@ -21,16 +21,16 @@ import Base.\
2121
#################
2222

2323
#This uses a very simple internal representation for skew diagrams
24-
\::partition, μ::partition) = Makeskewdiagram(λ, μ)
25-
function Makeskewdiagram::partition, μ::partition)
24+
\::Partition, μ::Partition) = MakeSkewDiagram(λ, μ)
25+
function MakeSkewDiagram::Partition, μ::Partition)
2626
m, n = length(λ), length(μ)
2727
if n>m error("Cannot construct skew diagram") end
2828
(λ, μ)
2929
end
3030

3131
#Checks if skew diagram is a rim hook
32-
isrimhook::partition, μ::partition)=isrimhook\ μ)
33-
function isrimhook::skewdiagram)
32+
isrimhook::Partition, μ::Partition)=isrimhook\ μ)
33+
function isrimhook::SkewDiagram)
3434
λ, μ = ξ
3535
m, n = length(λ), length(μ)
3636
if n>m error("Cannot construct skew diagram") end
@@ -74,8 +74,8 @@ end
7474

7575

7676
#Strictly speaking, defined for rim hook only, but here we define it for all skew diagrams
77-
leglength::partition, μ::partition)=leglength((λ \ μ))
78-
function leglength::skewdiagram)
77+
leglength::Partition, μ::Partition)=leglength((λ \ μ))
78+
function leglength::SkewDiagram)
7979
λ, μ = ξ
8080
m, n = length(λ), length(μ)
8181
#Construct matrix representation of diagram
@@ -99,7 +99,7 @@ end
9999
#######################
100100

101101
#Computes essential part of the partition sequence of lambda
102-
function partitionsequence(lambda::partition)
102+
function partitionsequence(lambda::Partition)
103103
Λ▔ = Int64[]
104104
λ = [lambda; 0]
105105
m = length(lambda)
@@ -121,7 +121,7 @@ isrimhook(a::Int64, b::Int64) = (a==1) && (b==0)
121121
#############################
122122

123123
#Computes recursively using the Murnaghan-Nakayama rule.
124-
function MN1inner(R::Vector{Int64}, T::Dict, μ::partition, t::Integer)
124+
function MN1inner(R::Vector{Int64}, T::Dict, μ::Partition, t::Integer)
125125
s=length(R)
126126
χ::Integer=1
127127
if t<=length(μ)
@@ -153,7 +153,7 @@ end
153153
# "The computational complexity of rules for the character table of Sn",
154154
# Journal of Symbolic Computation, vol. 37 iss. 6 (2004), pp 727-748.
155155
# doi:10.1016/j.jsc.2003.11.001
156-
function character::partition, μ::partition)
156+
function character::Partition, μ::Partition)
157157
T = {()=>0} #Sparse array implemented as dict
158158
Λ▔ = partitionsequence(λ)
159159
MN1inner(Λ▔, T, μ, 1)

test/Catalan_test.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ using Base.Test
4949
# integer_partitions
5050
@test integer_partitions(5) == {[1, 1, 1, 1, 1], [2, 1, 1, 1], [2, 2, 1], [3, 1, 1], [3, 2], [4, 1], [5]}
5151
@test_fails integer_partitions(-1)
52+
53+
# Young diagrams
54+
include("youngdiagrams.jl")

0 commit comments

Comments
 (0)