The structure 't' is overlapping if at least one memory location is visited twice while iterating through all possible tuples of indices.
(t)
| 492 | return p |
| 493 | |
| 494 | def is_overlapping(t): |
| 495 | """The structure 't' is overlapping if at least one memory location |
| 496 | is visited twice while iterating through all possible tuples of |
| 497 | indices.""" |
| 498 | memlen, itemsize, ndim, shape, strides, offset = t |
| 499 | visited = 1<<memlen |
| 500 | for ind in indices(shape): |
| 501 | i = memory_index(ind, t) |
| 502 | bit = 1<<i |
| 503 | if visited & bit: |
| 504 | return True |
| 505 | visited |= bit |
| 506 | return False |
| 507 | |
| 508 | def rand_structure(itemsize, valid, maxdim=5, maxshape=16, shape=()): |
| 509 | """Return random structure: |
no test coverage detected
searching dependent graphs…