@@ -43,131 +43,6 @@ function CodingTheory.degree_distributions_plot(C::AbstractLDPCCode)
4343 return f
4444end
4545
46- # """
47- # $TYPEDSIGNATURES
48-
49- # Return a bar graph and a dictionary of (length, count) pairs for unique short
50- # cycles in the Tanner graph of `C`. An empty graph and dictionary are returned
51- # when there are no cycles.
52-
53- # # Note
54- # - Short cycles are defined to be those with lengths between ``g`` and ``2g - 2``,
55- # where ``g`` is the girth.
56- # - Run `using Makie` to activate this extension.
57- # """
58- # function CodingTheory.count_short_cycles_plot(C::AbstractLDPCCode)
59- # if isempty(C.short_cycle_counts) || isempty(C.elementary_cycle_counts)
60- # CodingTheory._count_cycles(C)
61- # end
62-
63- # len = length(C.short_cycle_counts)
64- # x_data = [0 for _ in 1:len]
65- # y_data = [0 for _ in 1:len]
66- # index = 1
67- # for (i, j) in C.short_cycle_counts
68- # x_data[index] = i
69- # y_data[index] = j
70- # index += 1
71- # end
72-
73- # fig = Figure();
74- # ax = Axis(fig[1, 1], xlabel = "Cycle Length", ylabel = "Occurrences",
75- # title = "Short Cycle Counts")
76- # barplot!(ax, x_data, y_data, bar_width = 1, xticks = x_data, yticks = y_data)
77- # # fig = Plots.bar(x_data, y_data, bar_width = 1, xticks = x_data, yticks = y_data,
78- # # legend = false, xlabel = "Cycle Length", ylabel = "Occurrences",
79- # # title = "Short Cycle Counts")
80- # display(fig)
81- # return fig, C.short_cycle_counts
82- # end
83-
84- # """
85- # $TYPEDSIGNATURES
86-
87- # Return a bar graph and a dictionary of (length, count) pairs for unique elementary
88- # cycles in the Tanner graph of `C`. An empty graph and dictionary are returned
89- # when there are no cycles.
90-
91- # # Note
92- # - Elementary cycles do not contain the same vertex twice and are unable to be
93- # decomposed into a sequence of shorter cycles.
94- # - Run `using Makie` to activate this extension.
95- # """
96- # function CodingTheory.count_elementary_cycles_plot(C::AbstractLDPCCode)
97- # if isempty(C.short_cycle_counts) || isempty(C.elementary_cycle_counts)
98- # CodingTheory._count_cycles(C)
99- # end
100-
101- # len = length(C.elementary_cycle_counts)
102- # x_data = [0 for _ in 1:len]
103- # y_data = [0 for _ in 1:len]
104- # index = 1
105- # for (i, j) in C.elementary_cycle_counts
106- # x_data[index] = i
107- # y_data[index] = j
108- # index += 1
109- # end
110-
111- # fig = Figure();
112- # ax = Axis(fig[1, 1], xlabel = "Cycle Length", ylabel = "Occurrences",
113- # title = "Elementary Cycle Counts")
114- # barplot!(ax, x_data, y_data, bar_width = 1, xticks = x_data, yticks = y_data)
115- # # fig = Plots.bar(x_data, y_data, bar_width = 1, xticks = x_data, yticks = y_data,
116- # # legend = false, xlabel = "Cycle Length", ylabel = "Occurrences",
117- # # title = "Elementary Cycle Counts")
118- # display(fig)
119- # return fig, C.elementary_cycle_counts
120- # end
121-
122- """
123- $TYPEDSIGNATURES
124-
125- Return an interactive figure and data for the ACE spectrum of the Tanner graph of `C`.
126-
127- # Note
128- - Run `using Makie` to activate this extension.
129- """
130- function CodingTheory. ACE_spectrum_plot (C:: AbstractLDPCCode )
131- # TODO : remove WGLMakie as a default use and only use for interactive plots
132- fig = Figure ();
133- ax = Axis (fig[1 , 1 ], xlabel = " ACE" , ylabel = " Occurrences" , title = " ACE Spectrum" )
134- sg = SliderGrid (fig[2 , 1 ], (label = " Cycle Length" , range = girth: 2 : 2 * girth - 2 ,
135- startvalue = 4 ))
136-
137- x_max = maximum (reduce (vcat, vs_ACEs))
138- y_max = 0
139- counts = ACE_spectrum (C)
140- X_data = Observable (Vector {Int} ())
141- Y_data = Observable (Vector {Int} ())
142- barplot! (ax, X_data, Y_data, bar_width = 1 , xticks = X_data, yticks = Y_data)
143- for (k, l) in enumerate (girth: 2 : 2 * girth - 2 )
144-
145- ys = collect (values (counts[k]))
146- y_max = maximum ([y_max; ys])
147-
148- on (sg. sliders[1 ]. value) do val
149- if to_value (val) == l
150- X_data. val = collect (keys (counts[k]))
151- Y_data. val = ys
152- notify (X_data)
153- notify (Y_data)
154- end
155- end
156- end
157-
158- GLMakie. limits! (0 , x_max + 1 , 0 , y_max + 2 )
159- display (fig)
160- return fig, counts
161- end
162-
163- mutable struct _ComputationGraphNode
164- id:: Int
165- parent_id:: Int
166- lvl:: Int
167- vertex_number:: Int
168- type:: Symbol
169- end
170-
17146# doesn't seem to be a point in making this dynamic with a slider, as it simply
17247# continues in the same tree shape and no useful information is gained from watching it
17348"""
0 commit comments