Changeset 7769:dc5a439d4d5f


Ignore:
Timestamp:
11/27/07 04:52:58 (5 years ago)
Author:
R. L. Miller <rlmillster@…>
Branch:
default
Message:

fixed partition stack comparison

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/coding/binary_code.pyx

    r7767 r7769  
    19691969 
    19701970    cdef int cmp(self, PartitionStack other, BinaryCode CG): 
    1971         cdef int *cur_span = self.col_counts # grab spare scratch space, size self.nwords. 
    19721971        cdef int *self_wd_ents = self.wd_ents 
    1973         cdef int i, j, k, l, m, word, span = 1, ncols = self.ncols, nwords = self.nwords 
    1974         cur_span[0] = 0 
    1975         for i from 0 <= i < CG.nwords/2 + 1: 
    1976             word = self_wd_ents[i] 
    1977             k = 0 
    1978             while k < span and word != cur_span[k]: 
    1979                 k += 1 
    1980             if k == span: 
    1981                 if (span << 1) != nwords: 
    1982                     for j from 0 <= j < span: 
    1983                         cur_span[span+j] = cur_span[j] ^ word 
    1984                 span << 1 
    1985                 for j from 0 <= j < ncols: 
    1986                     l = CG.is_one(self.wd_ents[i], self.col_ents[j]) 
    1987                     m = CG.is_one(other.wd_ents[i], other.col_ents[j]) 
    1988                     if l != m: 
    1989                         return l - m 
    1990                 if span == nwords: break 
     1972        cdef int *CG_words = CG.words 
     1973        cdef int i, j, l, m, span = 1, ncols = self.ncols, nwords = self.nwords 
     1974        for i from 0 <= i < nwords: # TODO: probably don't need to check i == 0 here! 
     1975            for j from 0 <= j < ncols: 
     1976                l = CG.is_one(self.wd_ents[i], self.col_ents[j]) 
     1977                m = CG.is_one(other.wd_ents[i], other.col_ents[j]) 
     1978                if l != m: 
     1979                    return l - m 
    19911980        return 0 
    19921981 
     
    23302319                        print "W[k]: words", [Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j] 
    23312320                print nu 
    2332                 if hh != -1: print zeta 
    2333             if False: 
     2321                if hh != -1: 
     2322                    print zeta 
     2323                    print rho 
    23342324                print "h:", h 
    23352325                print "hzf:", hzf__h_zeta 
     
    23392329                print 'hzf__h_zeta', hzf__h_zeta 
    23402330                print 'qzb', qzb 
    2341             if False: 
    23422331                print "state:", state 
    23432332                print '-----' 
    23442333            badass += 1 
    2345             #if badass > 92: break 
    2346             #if badass > 2: break 
     2334#            if badass > 363: break 
    23472335 
    23482336            if state == 1: # Entry point: once only 
Note: See TracChangeset for help on using the changeset viewer.