Exemple #1
0
 def hashdatas():
     for i in range(3):
         for ii in ((i,), (i, 0), (1, i)):
             jj = tuple(FixedIndex(j) for j in ii)
             expr = MultiIndex(jj)
             reprs.add(repr(expr))
             hashes.add(hash(expr))
             yield compute_multiindex_hashdata(expr, {})
Exemple #2
0
 def hashdatas():
     ijs = []
     iind = indices(3)
     jind = indices(3)
     for i in iind:
         ijs.append((i,))
         for j in jind:
             ijs.append((i, j))
             ijs.append((j, i))
     for ij in ijs:
         expr = MultiIndex(ij)
         reprs.add(repr(expr))
         hashes.add(hash(expr))
         yield compute_multiindex_hashdata(expr, {})
Exemple #3
0
 def hashdatas():
     for rep in range(nrep):
         # Resetting index_numbering for each repetition,
         # resulting in hashdata staying the same for
         # each repetition but repr and hashes changing
         # because new indices are created each repetition.
         index_numbering = {}
         i, j, k, l = indices(4)
         for expr in (MultiIndex((i,)),
                      MultiIndex((i,)),  # r
                      MultiIndex((i, j)),
                      MultiIndex((j, i)),
                      MultiIndex((i, j)),  # r
                      MultiIndex((i, j, k)),
                      MultiIndex((k, j, i)),
                      MultiIndex((j, i))):  # r
             reprs.add(repr(expr))
             hashes.add(hash(expr))
             yield compute_multiindex_hashdata(expr, index_numbering)