Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
terasakisatoshi committed Mar 9, 2024
1 parent db47065 commit ec4b932
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 15 additions & 2 deletions ifs_lévy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using InteractiveUtils
begin
using Plots
using StaticArrays
using ConcreteStructs
using Distributions
end

Expand All @@ -27,12 +28,13 @@ md"""

# ╔═╡ 4ace389a-173a-11ee-0955-c1350a6f0427
begin
struct Affine
@concrete struct Affine
W
b
end

(aff::Affine)(x) = aff.W * x + aff.b
(aff::Affine)(x, y) = aff(@SVector [x, y])
end

# ╔═╡ 8abb0481-e408-4a47-b33f-6686871a45cd
Expand Down Expand Up @@ -68,17 +70,22 @@ end
# ╔═╡ 22dd99ac-4b53-4664-8ec7-9a7ce852ff9b
@benchmark generate_points($transforms, $catdist)

# ╔═╡ 8623c05b-484b-41e1-9ce8-a82621ec7d95


# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProfileSVG = "132c30aa-f267-4189-9183-c8a63c7e05e6"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[compat]
BenchmarkTools = "~1.3.2"
ConcreteStructs = "~0.2.3"
Distributions = "~0.25.97"
Plots = "~1.38.16"
ProfileSVG = "~0.2.1"
Expand All @@ -91,7 +98,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """
julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "ced0798757798ffc1e6810485816c69aa95e6f38"
project_hash = "747ff2c36366c9959864189f3ba574b00165a45b"
[[deps.AbstractTrees]]
git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5"
Expand Down Expand Up @@ -182,6 +189,11 @@ deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.0+0"
[[deps.ConcreteStructs]]
git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34"
uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
version = "0.2.3"
[[deps.ConcurrentUtilities]]
deps = ["Serialization", "Sockets"]
git-tree-sha1 = "96d823b94ba8d187a6d8f0826e731195a74b90e9"
Expand Down Expand Up @@ -1244,5 +1256,6 @@ version = "1.4.1+0"
# ╠═d3533d36-5f4e-4d70-8503-ebf590516d43
# ╠═c3e59e97-0ef7-409b-afe9-e123cc92770a
# ╠═22dd99ac-4b53-4664-8ec7-9a7ce852ff9b
# ╠═8623c05b-484b-41e1-9ce8-a82621ec7d95
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002
4 changes: 3 additions & 1 deletion ifs_revised.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pattern2ifs = Dict(
)

# ╔═╡ 8abb0481-e408-4a47-b33f-6686871a45cd
begin
(transforms, catdist) = let
_transforms, _catdist = pattern2ifs[pattern]
if use_staticarrays
transforms = map(_transforms) do t
Expand All @@ -96,9 +96,11 @@ begin
end
p = SVector{length(_catdist.p)}(_catdist.p)
catdist = Categorical(p)
(transforms, catdist)
else
transforms = _transforms
catdist = _catdist
(transforms, catdist)
end
end

Expand Down

0 comments on commit ec4b932

Please sign in to comment.