Skip to content

Commit

Permalink
Move around a few names, since types and modules cannot have the same…
Browse files Browse the repository at this point in the history
… names.

I like the new names.
  • Loading branch information
ViralBShah committed Jan 17, 2013
1 parent 19b36a2 commit 7863357
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export
LAPACK,
BLAS,
LibRandom,
RNG,
Random,
Math,
Sort,
Test,
Expand Down
9 changes: 5 additions & 4 deletions base/rng.jl → base/random.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module RNG
module Random

using Base.LibRandom

Expand All @@ -11,12 +11,10 @@ export librandom_init, srand,
randchi2, randchi2!,
randbeta, randbeta!,
randbool, randbool!,
AbstractRNG, MersenneTwister
AbstractRNG, RNG, MersenneTwister

abstract AbstractRNG

const RNG = MersenneTwister

type MersenneTwister <: AbstractRNG
state::DSFMT_state
seed::Union(Uint32,Vector{Uint32})
Expand Down Expand Up @@ -44,6 +42,9 @@ type MersenneTwister <: AbstractRNG
end
end

# MersenneTwister is the default RNG.
const RNG = MersenneTwister

function srand(r::MersenneTwister, seed)
r.seed = seed
dsfmt_init_gen_rand(r.state, seed)
Expand Down
10 changes: 5 additions & 5 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ importall Math
# random number generation and statistics
include("statistics.jl")
include("librandom.jl")
include("rng.jl")
importall RNG
include("random.jl")
importall Random

# Combinatorics
include("sort.jl")
Expand Down Expand Up @@ -201,10 +201,10 @@ compile_hint(cmp, (Int32, Int32))
compile_hint(min, (Int32, Int32))
compile_hint(==, (ASCIIString, ASCIIString))
compile_hint(arg_gen, (ASCIIString,))
compile_hint(RNG.librandom_init, ())
compile_hint(RNG.srand, (ASCIIString, Int))
compile_hint(Random.librandom_init, ())
compile_hint(Random.srand, (ASCIIString, Int))
compile_hint(Random.srand, (Uint64,))
compile_hint(open, (ASCIIString, Bool, Bool, Bool, Bool))
compile_hint(RNG.srand, (Uint64,))
compile_hint(done, (IntSet, Int64))
compile_hint(next, (IntSet, Int64))
compile_hint(ht_keyindex, (Dict{Any,Any}, Int32))
Expand Down

0 comments on commit 7863357

Please sign in to comment.