Skip to content

Commit 7f17781

Browse files
committed
flattening refactor and show() for AngledInternalAddress
1 parent 3395016 commit 7f17781

22 files changed

+64
-119
lines changed

Manifest.toml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.11.1"
44
manifest_format = "2.0"
5-
project_hash = "74c0bf4d8402a002223529b16ce89f50dc321b94"
5+
project_hash = "6277cafafbf607b44d7cdb3f1f8ae6312d05d56e"
66

77
[[deps.AbstractFFTs]]
88
deps = ["LinearAlgebra"]
@@ -273,11 +273,6 @@ git-tree-sha1 = "cc5231d52eb1771251fbd37171dbc408bcc8a1b6"
273273
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
274274
version = "2.6.4+0"
275275

276-
[[deps.ExprTools]]
277-
git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec"
278-
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
279-
version = "0.1.10"
280-
281276
[[deps.Extents]]
282277
git-tree-sha1 = "81023caa0021a41712685887db1fc03db26f41f5"
283278
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
@@ -837,12 +832,6 @@ version = "1.2.0"
837832
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
838833
version = "1.11.0"
839834

840-
[[deps.Mocking]]
841-
deps = ["Compat", "ExprTools"]
842-
git-tree-sha1 = "c74e5e7c5f83ccb0bca0377d316d966d296106d4"
843-
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
844-
version = "0.7.9"
845-
846835
[[deps.ModernGL]]
847836
deps = ["Libdl"]
848837
git-tree-sha1 = "b76ea40b5c0f45790ae09492712dd326208c28b2"
@@ -859,12 +848,6 @@ version = "0.3.4"
859848
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
860849
version = "2023.12.12"
861850

862-
[[deps.Mustache]]
863-
deps = ["Printf", "Tables"]
864-
git-tree-sha1 = "3b2db451a872b20519ebb0cec759d3d81a1c6bcb"
865-
uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
866-
version = "1.0.20"
867-
868851
[[deps.Netpbm]]
869852
deps = ["FileIO", "ImageCore", "ImageMetadata"]
870853
git-tree-sha1 = "d92b107dbb887293622df7697a2223f9f8176fcd"
@@ -975,12 +958,6 @@ git-tree-sha1 = "e127b609fb9ecba6f201ba7ab753d5a605d53801"
975958
uuid = "36c8627f-9965-5494-a995-c6b170f724f3"
976959
version = "1.54.1+0"
977960

978-
[[deps.Parameters]]
979-
deps = ["OrderedCollections", "UnPack"]
980-
git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe"
981-
uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a"
982-
version = "0.12.3"
983-
984961
[[deps.Parsers]]
985962
deps = ["Dates", "PrecompileTools", "UUIDs"]
986963
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
@@ -1002,12 +979,6 @@ weakdeps = ["REPL"]
1002979
[deps.Pkg.extensions]
1003980
REPLExt = "REPL"
1004981

1005-
[[deps.PkgTemplates]]
1006-
deps = ["Dates", "InteractiveUtils", "LibGit2", "Mocking", "Mustache", "Parameters", "Pkg", "REPL", "UUIDs"]
1007-
git-tree-sha1 = "18626dfafdd45a49c47b66071498d75ab08633f7"
1008-
uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
1009-
version = "0.7.53"
1010-
1011982
[[deps.PkgVersion]]
1012983
deps = ["Pkg"]
1013984
git-tree-sha1 = "f9501cc0430a26bc3d156ae1b5b0c1b47af4d6da"
@@ -1365,11 +1336,6 @@ deps = ["Random", "SHA"]
13651336
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
13661337
version = "1.11.0"
13671338

1368-
[[deps.UnPack]]
1369-
git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
1370-
uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1371-
version = "1.0.2"
1372-
13731339
[[deps.Unicode]]
13741340
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
13751341
version = "1.11.0"

Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
88
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
99
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
1010
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
11-
PkgTemplates = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
1211
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
1312

1413
[compat]
14+
ColorSchemes = "3"
1515
Colors = "0.12"
16-
Primes = "0.5"
1716
GLMakie = "0.10"
18-
PkgTemplates = "0.7"
19-
ColorSchemes = "3"
2017
IterTools = "1"
18+
Primes = "0.5"
2119
julia = "1.6.7"
2220

2321
[extras]
File renamed without changes.

src/trees/HubbardTrees.jl renamed to src/HubbardTrees.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#Algorithms from https://eudml.org/doc/283172
22
#Existence of quadratic Hubbard trees
33
#Henk Bruin, Alexandra Kafll, Dierk Schleicher
4-
5-
include("../sequences/AngleDoubling.jl")
6-
include("Graphs.jl")
7-
84
abstract type AbstractHubbardTree <: Graph end
95

106
function criticalpoint(H::AbstractHubbardTree)

src/Mandelbrot.jl

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,46 @@
11
module Mandelbrot
2-
include("trees/ShowTree.jl")
32

4-
export RationalAngle
5-
export BinaryExpansion
6-
export KneadingSequence
3+
export RationalAngle,
4+
BinaryExpansion,
5+
KneadingSequence,
6+
InternalAddress,
7+
HubbardTree,
8+
AngledInternalAddress,
9+
OrientedHubbardTree,
10+
parameter,
11+
treeplot,
12+
spiderplot
713

8-
export InternalAddress
9-
export HubbardTree
14+
using ColorSchemes,
15+
Colors,
16+
GLMakie,
17+
IterTools,
18+
Primes
1019

11-
export AngledInternalAddress
12-
export OrientedHubbardTree
20+
include("Sequences.jl")
21+
include("angledoubling.jl")
1322

14-
export parameter
23+
include("Graphs.jl")
24+
include("HubbardTrees.jl")
1525

16-
#export HyperbolicComponent
26+
include("orienttrees.jl")
27+
include("dynamicrays.jl")
28+
include("embedtrees.jl")
29+
30+
include("interiorbinarydecomp.jl")
31+
include("juliaset.jl")
32+
include("lamination.jl")
33+
include("mandelbrotset.jl")
34+
35+
include("spiderfuncs.jl")
36+
include("spidermap.jl")
37+
38+
include("renderfractal.jl")
39+
include("perturb.jl")
40+
41+
include("showrays.jl")
42+
include("showspider.jl")
43+
include("showtree.jl")
1744

18-
#export treeplot
1945

2046
end

src/sequences/Sequences.jl renamed to src/Sequences.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using Primes
2-
using IterTools
3-
41
struct Sequence{T}
52
items::Vector{T}
63
preperiod::Int
@@ -72,12 +69,12 @@ function Base.hash(S::Sequence,h::UInt)
7269
end
7370

7471
function Base.show(io::IO, K::Sequence)
75-
str = join([repr(item) for item in K.items])
72+
str = join([string(item) for item in K.items])
7673
L = K.preperiod
7774
if L == 0
78-
return println(io,"|"*str*"|")
75+
return print(io,"|"*str*"|")
7976
else
80-
return println(io,str[1:L]*"|"*str[L+1:end]*"|")
77+
return print(io,str[1:L]*"|"*str[L+1:end]*"|")
8178
end
8279
end
8380

src/spidermap/paths.jl renamed to src/__paths__.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using GLMakie
2-
include("SpiderFuncs.jl")
3-
41
A = 1.0-3.0im
52
B = -2.0+1.0im
63

src/sequences/AngleDoubling.jl renamed to src/angledoubling.jl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
include("Sequences.jl")
21

3-
alphabet = ['*','A','B']
42

53
struct RationalAngle <: Number
64
value::Rational
@@ -26,6 +24,10 @@ phi::RationalAngle < theta::RationalAngle = phi.value < theta.value
2624
denominator(theta::RationalAngle) = denominator(theta.value)
2725
numerator(theta::RationalAngle) = numerator(theta.value)
2826

27+
function Base.show(io::IO, theta::RationalAngle)
28+
return print(io,theta.value)
29+
end
30+
2931
function orbit(angle::RationalAngle)
3032
items = RationalAngle[]
3133

@@ -40,7 +42,7 @@ function orbit(angle::RationalAngle)
4042

4143
end
4244

43-
struct KneadingSymbol <: Integer
45+
struct KneadingSymbol #<: Integer <--- got rid of this due to issues with converting to a string
4446
value::Int
4547
function KneadingSymbol(value::Int)
4648
0 <= value <=2 || error("Value must be in range [0, 2]")
@@ -51,6 +53,8 @@ end
5153
#necessary for using kneading sequences as dictionary keys
5254
Base.hash(d::KneadingSymbol,h::UInt64) = hash(d.value,h)
5355

56+
alphabet = ['*','A','B']
57+
5458
function KneadingSymbol(c::Char)
5559
return KneadingSymbol(first(findall(x->x==c,alphabet))-1)
5660
end
@@ -220,7 +224,20 @@ function AngledInternalAddress(theta::RationalAngle)
220224
end
221225

222226
function AngledInternalAddress(theta::Rational)
223-
return AngledInternalAddress(Rationalangle(theta))
227+
return AngledInternalAddress(RationalAngle(theta))
228+
end
229+
230+
function Base.show(io::IO, AIA::AngledInternalAddress)
231+
address = ""
232+
for ii in eachindex(AIA.addr)
233+
address *= repr(AIA.addr[ii])
234+
if ii < lastindex(AIA.addr)#this will return true if num is not the last element because addr has no repeats
235+
address *= "———"
236+
address *= repr(AIA.angles[ii])
237+
address *= "——>"
238+
end
239+
end
240+
return print(io,"Angled Internal Address"*"\n"*address)
224241
end
225242

226243
function firstaddress(intadd::Vector{Int})

src/parameters/DynamicRays.jl renamed to src/dynamicrays.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
include("../sequences/AngleDoubling.jl")
2-
include("../spidermap/SpiderFuncs.jl")
3-
41
struct ExternalRays
52
orb::Sequence{BinaryExpansion}
63
rays::Dict{BinaryExpansion,Vector{ComplexF64}}

src/trees/EmbedTrees.jl renamed to src/embedtrees.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
include("OrientTrees.jl")
2-
include("../spidermap/SpiderMap.jl")
3-
include("../parameters/DynamicRays.jl")
4-
51
struct HyperbolicComponent
62
criticalpoint::Sequence
73
adj::Dict{KneadingSequence,Vector{KneadingSequence}}

0 commit comments

Comments
 (0)