Changeset 7771:70fff0d55851


Ignore:
Timestamp:
12/11/07 14:30:46 (5 years ago)
Author:
R. L. Miller <rlmillster@…>
Branch:
default
Message:

fixed obnoxious bug caused by subtle typos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/coding/binary_code.pyx

    r7770 r7771  
    22942294            raise NotImplementedError("Must supply a nontrivial code.") 
    22952295 
    2296         badass = 0 
    2297         LLL = [] 
    2298  
    22992296        state = 1 
    23002297        while state != -1: 
    2301             print badass 
    2302             if False:#badass > 620: 
     2298            if False: 
    23032299                print '-----' 
    2304                 print badass 
    23052300                print "k:", k 
    23062301                if k != -1: 
     
    23332328                                    L += '0' 
    23342329                        print "W[k]: words", L#[Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j]                 
    2335                 print "state:", state 
    2336                 print '-----' 
    2337             if False:#badass > 620: 
    2338                 print '-----' 
    2339                 print badass 
    2340                 print "k:", k 
    2341                 if k != -1: 
    2342                     if v[k]&nu.flag: 
    2343                         print "v[k]: word ", v[k]^nu.flag 
    2344                     else: 
    2345                         print "v[k]: col ", v[k] 
    2346                     if tvc&nu.flag: 
    2347                         print "tvc- wd", tvc^nu.flag 
    2348                     else: 
    2349                         print "tvc- col", tvc 
    2350                     if W[self.Phi_size * k]: 
    2351                         print "W[k]: cols", Integer(W[self.Phi_size * k]).binary() 
    2352                     else: 
    2353                         j = nwords/self.radix 
    2354                         if nwords%self.radix: 
    2355                             j += 1 
    2356                         print "W[k]: words", [Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j] 
    23572330                print nu 
    2358                 if hh != -1: 
     2331                if h != -1: 
    23592332                    print zeta 
    23602333                    print rho 
     
    23682341                print "state:", state 
    23692342                print '-----' 
    2370             badass += 1 
    2371 #            if badass > 363: break 
    23722343 
    23732344            if state == 1: # Entry point: once only 
     
    24952466 
    24962467                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 
    25002470                # if C^gamma == C, the permutation is an automorphism, goto 10 
    2501                 #if badass > 620: 
    2502                 print C.is_automorphism(col_gamma, word_gamma) 
    25032471                if C.is_automorphism(col_gamma, word_gamma): 
    25042472                    state = 10 
    25052473                else: 
    2506                     LLL.append([[col_gamma[i] for i from 0 <= i < ncols],[word_gamma[i] for i from 0 <= i < nwords]]) 
    25072474                    state = 8 
    25082475 
     
    25252492                # if C(nu) == C(rho), get the automorphism and goto 10 
    25262493                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 
    25302496                state = 10 
    25312497 
     
    25852551                # Now incorporate the automorphism into Theta 
    25862552                j = Theta.merge_perm(col_gamma, word_gamma) 
    2587                 if badass > 620: print Theta 
    25882553 
    25892554                # j stores whether anything happened or not- if not, then the automorphism we have 
     
    27432708 
    27442709            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 
    27452712                if e[k] == 0: # now is the time to narrow down W[k] by Omega and Phi 
    27462713                    # intersect W[k] with each Omega[i] such that v[0]...v[k-1] is in Phi[i] 
    2747                     jjj = self.Phi_size*k 
    27482714                    jj = self.Phi_size*self.L 
    2749                     iii = nwords/self.radix + 1 
     2715                    iii = nwords/self.radix 
    27502716                    if nwords%self.radix: 
    27512717                        iii += 1 
     
    27612727                        ii = self.Phi_size*i 
    27622728                        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! 
    27642730                                W[jjj + j] &= Omega[ii + j] 
    27652731                e[k] = 1 
     2732 
    27662733                # see if there is a vertex to split out 
    27672734                if nu.flag&v[k]: 
     
    28012768                state = 13 
    28022769 
    2803         for LL in LLL: 
    2804             print LL, ',\\' 
    28052770        # end big while loop 
    28062771        rho.find_basis(ham_wts) 
Note: See TracChangeset for help on using the changeset viewer.