Changeset 7769:dc5a439d4d5f
- Timestamp:
- 11/27/07 04:52:58 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/coding/binary_code.pyx (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/coding/binary_code.pyx
r7767 r7769 1969 1969 1970 1970 cdef int cmp(self, PartitionStack other, BinaryCode CG): 1971 cdef int *cur_span = self.col_counts # grab spare scratch space, size self.nwords.1972 1971 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 1991 1980 return 0 1992 1981 … … 2330 2319 print "W[k]: words", [Integer(W[self.Phi_size * k + 1 + i]).binary() for i from 0 <= i < j] 2331 2320 print nu 2332 if hh != -1: print zeta 2333 if False: 2321 if hh != -1: 2322 print zeta 2323 print rho 2334 2324 print "h:", h 2335 2325 print "hzf:", hzf__h_zeta … … 2339 2329 print 'hzf__h_zeta', hzf__h_zeta 2340 2330 print 'qzb', qzb 2341 if False:2342 2331 print "state:", state 2343 2332 print '-----' 2344 2333 badass += 1 2345 #if badass > 92: break 2346 #if badass > 2: break 2334 # if badass > 363: break 2347 2335 2348 2336 if state == 1: # Entry point: once only
Note: See TracChangeset
for help on using the changeset viewer.
