Skip to content

Commit 619c9e0

Browse files
committed
Export methods
1 parent 1123b2e commit 619c9e0

File tree

6 files changed

+39
-27
lines changed

6 files changed

+39
-27
lines changed

src/FastHistogram.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export hist_eig
2+
13
#Uses the method of Sturm sequences to compute the histogram of eigenvalues of a matrix
24
#
35
# Reference
@@ -25,7 +27,6 @@ function hist_eig{GridPoint <: Number}(M::AbstractMatrix, bins::Vector{GridPoint
2527
histogram[BinId] = sum([r < 0 for r in SturmRatioSequence])
2628
end
2729
histogram = int(diff([histogram; n]))
28-
return histogram
2930
end
3031

3132

@@ -52,6 +53,5 @@ function hist_eig{GridPoint <: Number}(M::SymTridiagonal, bins::Vector{GridPoint
5253
histogram[BinId] = sum([SturmRatio < 0 for SturmRatio in r])
5354
end
5455
histogram = int(diff([histogram; n]))
55-
return histogram
5656
end
5757

src/FormalPowerSeries.jl

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
# Power Series---Integration---Conformal Mapping---Location of Zeros,
1010
# Wiley-Interscience: New York, 1974
1111

12-
import Base.inv, Base.length
12+
import Base.eye, Base.inv, Base.length,
13+
Base.==, Base.+, Base.-, Base.*, Base..*, Base.^
14+
export FormalPowerSeries, tovector, trim, isunit, isnonunit,
15+
MatrixForm, reciprocal, derivative, isconstant, compose,
16+
isalmostunit, FormalLaurentSeries
1317

1418
#############################
1519
# Formal power series (fps) #
@@ -44,6 +48,20 @@ function tovector{T}(P::FormalPowerSeries{T}, n :: Integer)
4448
end
4549

4650

51+
# Basic housekeeping and properties
52+
53+
# Remove extraneous zeros
54+
function trim{T}(P::FormalPowerSeries{T})
55+
for (k,v) in P.c
56+
if v==0
57+
delete!(P.c, k)
58+
end
59+
end
60+
return P
61+
end
62+
63+
length{T}(P::FormalPowerSeries{T})=max([k for (k,v) in P.c])
64+
4765
function =={T}(P::FormalPowerSeries{T}, Q::FormalPowerSeries{T})
4866
for (k,v) in P.c
4967
if v==0 #ignore explicit zeros
@@ -66,22 +84,6 @@ function =={T}(P::FormalPowerSeries{T}, Q::FormalPowerSeries{T})
6684
return true
6785
end
6886

69-
70-
71-
# Basic housekeeping and properties
72-
73-
# Remove extraneous zeros
74-
function trim{T}(P::FormalPowerSeries{T})
75-
for (k,v) in P.c
76-
if v==0
77-
delete!(P.c, k)
78-
end
79-
end
80-
return P
81-
end
82-
83-
length{T}(P::FormalPowerSeries{T})=max([k for (k,v) in P.c])
84-
8587
# Basic arithmetic [H, p.10]
8688
function +{T}(P::FormalPowerSeries{T}, Q::FormalPowerSeries{T})
8789
c = Dict{BigInt, T}()

src/GaussianEnsembleDistributions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# doi: 10.1063/1.1507823
1010
# arXiv: math-ph/0206043
1111

12+
export VandermondeDeterminant, HermiteJPDF, LaguerreJPDF, JacobiJPDF
13+
1214
###
1315
# Joint probability density functions
1416
#
@@ -101,5 +103,3 @@ function JacobiJPDF{Eigenvalue<:FloatingPoint}(lambda :: Vector{Eigenvalue}, n1
101103
return c * VandermondeDeterminant(lambda, beta) * Prod * exp(-Energy)
102104
end
103105

104-
105-

src/GaussianEnsembleSamples.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
# doi: 10.1063/1.1507823
99
# arXiv: math-ph/0206043
1010

11+
using Distributions
12+
export GaussianHermiteMatrix, GaussianLaguerreMatrix, GaussianJacobiMatrix,
13+
GaussianHermiteTridiagonalMatrix, GaussianLaguerreTridiagonalMatrix,
14+
GaussianJacobiSparseMatrix,
15+
GaussianHermiteSamples, GaussianLaguerreSamples, GaussianJacobiSamples
16+
1117
#Generates a NxN symmetric Wigner matrix
1218
#Hermite ensemble
1319
function GaussianHermiteMatrix(n :: Integer, beta :: Integer)
@@ -57,7 +63,6 @@ end
5763

5864

5965
#A convenience function
60-
using Distributions
6166
chi(df) = sqrt(rand(Chisq(df)))
6267

6368
#Generates a NxN tridiagonal Wigner matrix

src/RandomMatrices.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
require("Distributions")
22

33
module RandomMatrices
4-
using Distributions
5-
4+
importall Distributions
5+
using Catalan
6+
67
#Classical Gaussian matrix ensembles
78
include("GaussianEnsembleSamples.jl")
9+
include("GaussianEnsembleDistributions.jl")
10+
811
# Classical univariate distributions
912
####################################
1013
include("densities/Semicircle.jl")
11-
#Tracy-Widom distribution
1214
include("densities/TracyWidom.jl")
1315

1416
#Fast histogrammer for matrix eigenvalues
1517
include("FastHistogram.jl")
1618

1719
#Formal power series
1820
include("FormalPowerSeries.jl")
19-
end
21+
end #module

src/densities/TracyWidom.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#Computes the Tracy-Widom distribution by directly solving the
22
#Painlevé II equation
3+
export TracyWidom
34
using ODE
5+
46
include("gradient.jl")
5-
function tracywidom(t::Real)
7+
8+
function TracyWidom(t::Real)
69
t0 = -8.0
710

811
t>t0 ? return 0.0 : nothing

0 commit comments

Comments
 (0)