@@ -131,7 +131,7 @@ def weight_dist(M):
131
131
bitset_zero(& basis[i])
132
132
for j in M.row(i).nonzero_positions():
133
133
bitset_set(& basis[i], j)
134
- for i from 0 <= i < deg+ 1 :
134
+ for i in range ( deg + 1 ) :
135
135
LL[i] = 0
136
136
bitset_init(word, deg)
137
137
bitset_zero(word)
@@ -147,9 +147,8 @@ def weight_dist(M):
147
147
k += 1
148
148
if k == dim:
149
149
break
150
- else :
151
- j ^= (1 << k)
152
- bitset_xor(word, word, & basis[k])
150
+ j ^= (1 << k)
151
+ bitset_xor(word, word, & basis[k])
153
152
bitset_free(word)
154
153
L = [int (LL[i]) for i from 0 <= i < deg+ 1 ]
155
154
for i from 0 <= i < dim:
@@ -329,9 +328,8 @@ cdef WordPermutation *create_word_perm(object list_perm) noexcept:
329
328
j += 1
330
329
if j == chunk_size:
331
330
break
332
- else :
333
- comb ^= (1 << j)
334
- image ^= images_i[1 << j]
331
+ comb ^= (1 << j)
332
+ image ^= images_i[1 << j]
335
333
return word_perm
336
334
337
335
cdef WordPermutation * create_array_word_perm(int * array, int start, int degree) noexcept:
@@ -380,9 +378,8 @@ cdef WordPermutation *create_array_word_perm(int *array, int start, int degree)
380
378
j += 1
381
379
if j == chunk_size:
382
380
break
383
- else :
384
- comb ^= (1 << j)
385
- image ^= images_i[1 << j]
381
+ comb ^= (1 << j)
382
+ image ^= images_i[1 << j]
386
383
return word_perm
387
384
388
385
cdef WordPermutation * create_id_word_perm(int degree) noexcept:
@@ -430,9 +427,8 @@ cdef WordPermutation *create_id_word_perm(int degree) noexcept:
430
427
j += 1
431
428
if j == chunk_size:
432
429
break
433
- else :
434
- comb ^= (1 << j)
435
- image ^= images_i[1 << j]
430
+ comb ^= (1 << j)
431
+ image ^= images_i[1 << j]
436
432
return word_perm
437
433
438
434
cdef WordPermutation * create_comp_word_perm(WordPermutation * g, WordPermutation * h) noexcept:
@@ -465,7 +461,7 @@ cdef WordPermutation *create_comp_word_perm(WordPermutation *g, WordPermutation
465
461
sig_free(word_perm)
466
462
raise RuntimeError (" Error allocating memory." )
467
463
word_perm.images[i] = images_i
468
- for j from 0 <= j < chunk_size:
464
+ for j in range ( chunk_size) :
469
465
image = (< codeword> 1 ) << (chunk_size* i + j)
470
466
image = permute_word_by_wp(h, image)
471
467
image = permute_word_by_wp(g, image)
@@ -483,9 +479,8 @@ cdef WordPermutation *create_comp_word_perm(WordPermutation *g, WordPermutation
483
479
j += 1
484
480
if j == chunk_size:
485
481
break
486
- else :
487
- comb ^= (1 << j)
488
- image ^= images_i[1 << j]
482
+ comb ^= (1 << j)
483
+ image ^= images_i[1 << j]
489
484
return word_perm
490
485
491
486
cdef WordPermutation * create_inv_word_perm(WordPermutation * g) noexcept:
@@ -2008,12 +2003,12 @@ cdef class PartitionStack:
2008
2003
length = 1 + nwords/ radix
2009
2004
if nwords % radix:
2010
2005
length += 1
2011
- for i from 0 <= i < length:
2006
+ for i in range ( length) :
2012
2007
Omega[start+ i] = 0
2013
- for i in range (ncols):
2008
+ for i in range (1 , ncols):
2014
2009
Omega[start] += ((self_col_lvls[i- 1 ] <= k) << self_col_ents[i])
2015
2010
Omega[start+ 1 ] = (1 << self_wd_ents[0 ])
2016
- for i in range (nwords):
2011
+ for i in range (1 , nwords):
2017
2012
if self_wd_lvls[i- 1 ] <= k:
2018
2013
word = self_wd_lvls[i- 1 ]
2019
2014
Omega[start+ 1 + word/ radix] += (1 << word % radix)
@@ -2873,7 +2868,7 @@ cdef class PartitionStack:
2873
2868
0
2874
2869
"""
2875
2870
cdef int i, j, l, m, ncols = self .ncols, nwords = self .nwords
2876
- for i in range (nwords):
2871
+ for i in range (1 , nwords):
2877
2872
for j in range (ncols):
2878
2873
l = CG.is_one(self .wd_ents[i], self .col_ents[j])
2879
2874
m = CG.is_one(other.wd_ents[i], other.col_ents[j])
0 commit comments