Skip to content

Commit

Permalink
removing multiple precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
kmarray98 committed Feb 28, 2024
1 parent 80e5a52 commit 7e63c66
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.0"
manifest_format = "2.0"
project_hash = "b63f305d0ed85d8bed38a9eb0d9764806b256538"
project_hash = "e7cfeb6672a779b8a5adb0ecf46a10b9bba4c575"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
Expand Down
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ authors = ["Kieran Marray"]
version = "0.1.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[compat]
julia = "1"
SpecialFunctions = "2.3"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
20 changes: 17 additions & 3 deletions src/PowerLawSamplers.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
module PowerLawSamplers

using SpecialFunctions
using SpecialFunctions, LinearAlgebra, Random

# Write your package code here.
export doubling_up_sampler, bounded_doubling_up_sampler, inexact_sampler, pl_graph

include("Samplers.jl")
include("RandomGraph.jl")
#include("RandomGraph.jl")

function pl_graph(n, α, x_min)
G = Matrix{Float64}(zeros(n, n))
us = rand(n)
for i in 1:n
#println(i)
neighbours = sample(1:n, bounded_doubling_up_sampler(α, x_min, us[i], n); replace=false)
G[i,neighbours] .= 1.0
end

return(G)

end

export doubling_up_sampler, bounded_doubling_up_sampler, inexact_sampler, pl_graph

end
13 changes: 0 additions & 13 deletions src/RandomGraph.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
include("Samplers.jl")

function pl_graph(n, α, x_min)
G = Matrix{Float64}(zeros(n, n))
us = rand(n)
for i in 1:n
#println(i)
neighbours = sample(1:n, bounded_double_up_sampler(α, x_min, us[i], n); replace=false)
G[i,neighbours] .= 1.0
end

return(G)

end
5 changes: 1 addition & 4 deletions src/Samplers.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using SpecialFunctions


"""
Exact sampler for observations from discrete power law distribution from Appendix D of Clauset, Shalizi, and Newman -
power law distributions in empirical data.
Expand All @@ -25,7 +22,7 @@ function doubling_up_sampler(α, x_min,u)
while zeta(α, guess)/zeta(α, x_min) 1-u
guess += 1
end
return(guess)
return(Int64(guess))
end

"""
Expand Down
1 change: 0 additions & 1 deletion src/hello

This file was deleted.

0 comments on commit 7e63c66

Please sign in to comment.