Introduction
Introduction Statistics Contact Development Disclaimer Help
tutil.jl - Granular.jl - Julia package for granular dynamics simulation
git clone git://src.adamsgaard.dk/Granular.jl
Log
Files
Refs
README
LICENSE
---
tutil.jl (1303B)
---
1 #!/usr/bin/env julia
2 import Granular
3 import Random
4 using Random
5 using Test
6
7 @info "Testing power-law RNG"
8
9 @test 1 == length(Granular.randpower())
10 @test () == size(Granular.randpower())
11 @test 1 == length(Granular.randpower(1))
12 @test () == size(Granular.randpower(1))
13 @test 4 == length(Granular.randpower((2,2)))
14 @test (2,2) == size(Granular.randpower((2,2)))
15 @test 5 == length(Granular.randpower(5))
16 @test (5,) == size(Granular.randpower(5))
17
18 Random.seed!(1)
19 for i=1:10^5
20 @test 0. <= Granular.randpower() <= 1.
21 @test 0. <= Granular.randpower(1, 1., 0., 1.) <= 1.
22 @test 0. <= Granular.randpower(1, 1., 0., .1) <= .1
23 @test 5. <= Granular.randpower(1, 1., 5., 6.) <= 6.
24 @test 0. <= minimum(Granular.randpower((2,2), 1., 0., 1.))
25 @test 1. >= maximum(Granular.randpower((2,2), 1., 0., 1.))
26 @test 0. <= minimum(Granular.randpower(5, 1., 0., 1.))
27 @test 1. >= minimum(Granular.randpower(5, 1., 0., 1.))
28 end
29
30 @test [1,2,0] == Granular.vecTo3d([1,2])
31 @test [1,2,3] == Granular.vecTo3d([1,2], fill=3)
32 @test [1,3,3] == Granular.vecTo3d([1], fill=3)
33 @test [1,3,3] == Granular.vecTo3d(1, fill=3)
34 @test [1.,2.,3.] == Granular.vecTo3d([1.,2.], fill=3.)
35 @test [1.,3.,3.] == Granular.vecTo3d(1., fill=3.)
36 @test [1.,0.,0.] == Granular.vecTo3d(1.)
37 @test [1.,0.,0.] == Granular.vecTo3d([1.])
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.