You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -117,7 +117,6 @@ plotkin_bound(q::T, n::T, d::T, ::Rounding) where T <: Integer =
117
117
elias_bassalygo_bound(q::T, n::T, d::T) where T <: Integer =
118
118
elias_bassalygo_bound(q::T, n::T, d::T, ::Rounding) where T <: Integer =
119
119
120
-
121
120
function__johnson_bound_core(round_func::Function, q::T, n::T, d::T) where T <: Integer
122
121
if isinteger((d -1) /2) # is odd
123
122
t = T((d - 1) / 2)
@@ -128,8 +127,6 @@ function __johnson_bound_core(round_func::Function, q::T, n::T, d::T) where T <:
128
127
end
129
128
end
130
129
131
-
132
-
133
130
"""
134
131
construct_ham_matrix(r::Int, q::Int) -> Matrix
135
132
@@ -271,7 +268,7 @@ end
271
268
272
269
Takes in an array and a word. As long as the word does not mean that the distance is smaller than d, we add w to the array. If we are successful in doing this, return true. Otherwise, return false. *This is a mutating function.*
273
270
"""
274
-
functionpush_if_allowed!(C::AbstractArray{T}, w::T, d::Int) where T
271
+
functionpush_if_allowed!(C::AbstractArray{T}, w::T, d::Int) where T<: AbstractWord
275
272
isempty(C) && (push!(C, w);return true)
276
273
277
274
forcin C
@@ -289,7 +286,7 @@ end
289
286
290
287
Takes in two arrays, A and B. If w is allowed in C given distance d, push to C′. If we are successful in doing this, return true. Otherwise, return false. *This is a mutating function.*
291
288
"""
292
-
functionpush_if_allowed!(C::AbstractArray{T}, C′::AbstractArray{T}, w::T, d::Int) where T
289
+
functionpush_if_allowed!(C::AbstractVector{T}, C′::AbstractVector{T}, w::T, d::Int) where T<: AbstractWord
293
290
isempty(C) && (push!(C′, w);return true)
294
291
295
292
forcin C
@@ -307,7 +304,7 @@ end
307
304
308
305
Takes in an array and a word. As long as the word does not mean that the distance is smaller than d, we replace a with b in the array. Replaces and returns true if allowed; otherwise returns false. *This is a mutating function.*
Search through the universe of all codewords and find a code of block length n and distance d, using the alphabet Σ. The alphabet will be uniquely generated if none is given.
383
376
@@ -389,21 +382,20 @@ Parameters:
389
382
- d::Int: The minimum distance between words in the code.
390
383
391
384
Returns:
392
-
- Array{Tuple{Symbol}, 1}: An array of codewords. Each codewords is a tuple, and each character in said word is a symbol.
385
+
- Codewords{M}: An array of codewords, each of length `M`. Each codewords is a tuple, and each character in said word is a symbol.
Search through the universe of all codewords at random and find a code of block length n and distance d, using the alphabet Σ. The alphabet will be uniquely generated if none is given.
432
424
@@ -438,32 +430,32 @@ Parameters:
438
430
- 𝒰::AbstractArray: The universe of all codewords of q many letters of block length n.
439
431
440
432
Returns:
441
-
- Array{Tuple{Symbol}, 1}: An array of codewords. Each codewords is a tuple, and each character in said word is a symbol.
433
+
- Codewords{M}: An array of codewords, each of length `M`. Each codewords is a tuple, and each character in said word is a symbol.
Use function `get_codewords_random` m many times, and `get_codewords_greedy`. Return the code with the greatest number of words. The alphabet will be uniquely generated if none is given. You can omit Σ and 𝒰. You can omit q if Σ is given.
517
509
@@ -524,11 +516,11 @@ Parameters:
524
516
- m::Int (kwarg): Try a random code m many times.
525
517
526
518
Returns:
527
-
- Array{Tuple{Symbol}, 1}: An array of codewords. Each codewords is a tuple, and each character in said word is a symbol.
519
+
- Codewords{M}: An array of codewords, each of length `M`. Each codewords is a tuple, and each character in said word is a symbol.
Get codewords of a code from the generating matrix under a finite field of modulo m. Precisely, computes all linear combinations of the rows of the generating matrix.
570
562
@@ -573,7 +565,7 @@ Parameters:
573
565
- m::Int: The bounds of the finite field (i.e., the molulus you wish to work in).
574
566
575
567
Returns:
576
-
- Array{Tuple{Symbol}, 1}: An array of codewords. Each codewords is a tuple, and each character in said word is a symbol.
568
+
- Codewords{M}: An array of codewords, each of length `M`. Each codewords is a tuple, and each character in said word is a symbol.
577
569
"""
578
570
functionget_codewords(G::AbstractArray, m::Int)
579
571
codewords = Vector()
@@ -583,7 +575,7 @@ function get_codewords(G::AbstractArray, m::Int)
0 commit comments