Changeset 7771:70fff0d55851
- Timestamp:
- 12/11/07 14:30:46 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/coding/binary_code.pyx (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/coding/binary_code.pyx
r7770 r7771 2294 2294 raise NotImplementedError("Must supply a nontrivial code.") 2295 2295 2296 badass = 02297 LLL = []2298 2299 2296 state = 1 2300 2297 while state != -1: 2301 print badass 2302 if False:#badass > 620: 2298 if False: 2303 2299 print '-----' 2304 print badass2305 2300 print "k:", k 2306 2301 if k != -1: … … 2333 2328 L += '0' 2334 2329 print "W[k]: words", L#[Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j] 2335 print "state:", state2336 print '-----'2337 if False:#badass > 620:2338 print '-----'2339 print badass2340 print "k:", k2341 if k != -1:2342 if v[k]&nu.flag:2343 print "v[k]: word ", v[k]^nu.flag2344 else:2345 print "v[k]: col ", v[k]2346 if tvc&nu.flag:2347 print "tvc- wd", tvc^nu.flag2348 else:2349 print "tvc- col", tvc2350 if W[self.Phi_size * k]:2351 print "W[k]: cols", Integer(W[self.Phi_size * k]).binary()2352 else:2353 j = nwords/self.radix2354 if nwords%self.radix:2355 j += 12356 print "W[k]: words", [Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j]2357 2330 print nu 2358 if h h!= -1:2331 if h != -1: 2359 2332 print zeta 2360 2333 print rho … … 2368 2341 print "state:", state 2369 2342 print '-----' 2370 badass += 12371 # if badass > 363: break2372 2343 2373 2344 if state == 1: # Entry point: once only … … 2495 2466 2496 2467 nu.get_permutation(zeta, word_gamma, col_gamma, ham_wts) 2497 #if badass > 620: 2498 print "gamma:", [word_gamma[i] for i from 0 <= i < nwords], [col_gamma[i] for i from 0 <= i < ncols] 2499 print Theta 2468 # print "gamma:", str([[word_gamma[i] for i from 0 <= i < nwords], [col_gamma[i] for i from 0 <= i < ncols]]).replace(' ','') 2469 # print Theta 2500 2470 # if C^gamma == C, the permutation is an automorphism, goto 10 2501 #if badass > 620:2502 print C.is_automorphism(col_gamma, word_gamma)2503 2471 if C.is_automorphism(col_gamma, word_gamma): 2504 2472 state = 10 2505 2473 else: 2506 LLL.append([[col_gamma[i] for i from 0 <= i < ncols],[word_gamma[i] for i from 0 <= i < nwords]])2507 2474 state = 8 2508 2475 … … 2525 2492 # if C(nu) == C(rho), get the automorphism and goto 10 2526 2493 rho.get_permutation(nu, word_gamma, col_gamma, ham_wts) 2527 #if badass > 620: 2528 print "gamma:", [word_gamma[i] for i from 0 <= i < nwords], [col_gamma[i] for i from 0 <= i < ncols] 2529 print Theta 2494 # print "gamma:", str([[word_gamma[i] for i from 0 <= i < nwords], [col_gamma[i] for i from 0 <= i < ncols]]).replace(' ','') 2495 # print Theta 2530 2496 state = 10 2531 2497 … … 2585 2551 # Now incorporate the automorphism into Theta 2586 2552 j = Theta.merge_perm(col_gamma, word_gamma) 2587 if badass > 620: print Theta2588 2553 2589 2554 # j stores whether anything happened or not- if not, then the automorphism we have … … 2743 2708 2744 2709 elif state == 17: # see if there are any more splits to make from this level of nu (and not zeta) 2710 2711 jjj = self.Phi_size*k 2745 2712 if e[k] == 0: # now is the time to narrow down W[k] by Omega and Phi 2746 2713 # intersect W[k] with each Omega[i] such that v[0]...v[k-1] is in Phi[i] 2747 jjj = self.Phi_size*k2748 2714 jj = self.Phi_size*self.L 2749 iii = nwords/self.radix + 12715 iii = nwords/self.radix 2750 2716 if nwords%self.radix: 2751 2717 iii += 1 … … 2761 2727 ii = self.Phi_size*i 2762 2728 for j from 0 <= j < iii: 2763 if Phi[ii + j] & Phi[jj + j] == Phi[jj + j]: 2729 if Phi[ii + j] & Phi[jj + j] == Phi[jj + j]: #should do the whole thing, not one at a time! 2764 2730 W[jjj + j] &= Omega[ii + j] 2765 2731 e[k] = 1 2732 2766 2733 # see if there is a vertex to split out 2767 2734 if nu.flag&v[k]: … … 2801 2768 state = 13 2802 2769 2803 for LL in LLL:2804 print LL, ',\\'2805 2770 # end big while loop 2806 2771 rho.find_basis(ham_wts)
Note: See TracChangeset
for help on using the changeset viewer.
