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
A_mats_trunc = [Matrix{UInt16}(undef, k, n-k) for _ in1:length(A_mats)]
503
-
for i in1:size(A_mats, 1)
504
-
A_mats_trunc[i] =deepcopy(A_mats[i][k+1: n, :])
514
+
A_mats_trunc = [Matrix{UInt16}(undef, k, n-k) for _ in1:length(A_mats)]
515
+
for i in1:size(A_mats, 1)
516
+
A_mats_trunc[i] =deepcopy(A_mats[i][k+1: n, :])
505
517
end
506
518
519
+
# I don't remember this case in the paper
507
520
if info_set_alg ==:Brouwer&& rnks[h] != k
508
521
println("Rank of last matrix too small")
509
522
return
510
523
end
524
+
# I think we have to remove this from the verbose statement to work
511
525
if verbose
512
526
print("Generated $h information sets with ranks: ")
513
527
for i in1:h
@@ -532,10 +546,10 @@ function _minimum_distance_BZ(C::AbstractLinearCode; info_set_alg::Symbol = :Zim
532
546
(!triply_even_flag &&!doubly_even_flag && even_flag) &&println("Detected an even code.")
533
547
end
534
548
535
-
# initial_perm_ind will match the permutation we use for the 'found' vector if the found vector is nonzero. To simplify the code below we're going to choose an initial permutation arbitrarily.
536
-
initial_perm_ind =1
537
-
# following loop is the r=1 case of the enumeration. We do this case here because we want to make a good guess at the terminating r before we start multiple threads
538
-
for (j, g) inenumerate(A_mats) # loop over the A_mats rather than the original G because it would add another case to deal with later
549
+
# initial_perm_ind will match the permutation we use for the 'found' vector if the found vector is nonzero. To simplify the code below we're going to choose an initial permutation arbitrarily.
550
+
initial_perm_ind =1
551
+
# following loop is the r = 1 case of the enumeration. We do this case here because we want to make a good guess at the terminating r before we start multiple threads
552
+
for (j, g) inenumerate(A_mats) # loop over the A_mats rather than the original G because it would add another case to deal with later
539
553
# can make this faster with dots and views
540
554
w, i =_min_wt_col(g)
541
555
if w <= C.u_bound
@@ -546,13 +560,15 @@ function _minimum_distance_BZ(C::AbstractLinearCode; info_set_alg::Symbol = :Zim
# I'm actually surpised this works since Oscar now requires [:, 1:1] for most things
549
564
found = A_mats[1][:, 1]
550
565
551
566
l =0
552
-
if verbose
567
+
# not entirely sure what's going on here since it's never used later, I guess just for testing, but if we want it printed it never ends up printed with the current comments
b_lower_bounds = [information_set_lower_bound(r+1, n, k, l, [k -0for i in1:b_h], :Brouwer, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
571
+
b_lower_bounds = [information_set_lower_bound(r+1, n, k, l, [k -0for i in1:b_h], :Brouwer, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
556
572
b_r_term =findfirst(x -> x ≥ C.u_bound, b_lower_bounds)
@@ -563,38 +579,41 @@ function _minimum_distance_BZ(C::AbstractLinearCode; info_set_alg::Symbol = :Zim
563
579
# verbose && println("Predicted termination weight based on current upper bound: Brouwer $b_r_term Zimm $z_r_term")
564
580
end
565
581
566
-
#Note the r+1 here.
567
-
lower_bounds_for_prediction = [information_set_lower_bound(r+1, n, k, l, rank_defs, info_set_alg, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
582
+
#Note the r + 1 here
583
+
lower_bounds_for_prediction = [information_set_lower_bound(r+1, n, k, l, rank_defs, info_set_alg, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
568
584
r_term =findfirst(x -> x ≥ C.u_bound, lower_bounds_for_prediction)
569
585
ifisnothing(r_term)
570
-
raise(DomainError("invalid termination r"))
586
+
raise(DomainError("Invalid termination r"))
571
587
end
572
588
verbose &&println("Predicted termination weight based on current upper bound: $r_term")
573
589
574
-
#In the main loop we check if lower bound > upper bound before we enumerate and so the lower bounds for the loop use r not r+1
575
-
lower_bounds = [information_set_lower_bound(r, n, k, l, rank_defs, info_set_alg, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
590
+
#In the main loop we check if lower bound > upper bound before we enumerate and so the lower bounds for the loop use r not r + 1
591
+
lower_bounds = [information_set_lower_bound(r, n, k, l, rank_defs, info_set_alg, even = even_flag, doubly_even = doubly_even_flag, triply_even = triply_even_flag) for r in1:k-1]
576
592
577
593
predicted_work_factor =fld(n, k) *sum([binomial(k, i) for i in1:r_term])
578
594
verbose &&println("Predicted work factor: $predicted_work_factor")
579
595
if show_progress
580
-
prog_bar =Progress(predicted_work_factor, dt=1.0, showspeed=true) # updates no faster than once every 1s
596
+
prog_bar =Progress(predicted_work_factor, dt=1.0, showspeed=true) # updates no faster than once every 1s
581
597
end
582
-
weight_sum_bound =min(2* C.u_bound +5, n-k)
598
+
# don't understand this but okay
599
+
weight_sum_bound =min(2* C.u_bound +5, n - k)
583
600
verbose &&println("Codeword weights initially checked on first $weight_sum_bound entries")
584
601
585
602
num_thrds = Threads.nthreads()
586
603
verbose &&println("Number of threads ", num_thrds)
587
604
for r in2:k
605
+
#TODO this case should never happen given the error above?
588
606
if r >2^16
589
607
verbose &&println("Warning: Reached an r larger than 2^16")
0 commit comments