Lines Matching defs:rslices

370 def m_assign(llst, rlst, lslices, rslices):
372 lslices and rslices are lists of slice objects. llst and rlst must
382 rslices = [slice(1,3,1), slice(1,3,1)]
383 multislice_assign(llst, rlst, lslices, rslices)
387 rlst = [m_assign(l, r, lslices[1:], rslices[1:])
388 for l, r in zip(llst[lslices[0]], rlst[rslices[0]])]
392 def cmp_structure(llst, rlst, lslices, rslices):
393 """Compare the structure of llst[lslices] and rlst[rslices]."""
395 rshape = slice_shape(rlst, rslices)
405 def multislice_assign(llst, rlst, lslices, rslices):
406 """Return llst after assigning: llst[lslices] = rlst[rslices]"""
407 if cmp_structure(llst, rlst, lslices, rslices) < 0:
409 return m_assign(llst, rlst, lslices, rslices)
566 such that shapeof(x[lslices]) == shapeof(x[rslices])."""
568 rslices = [0] * ndim
573 rslices[n] = randslice_from_slicelen(slicelen, l)
574 return tuple(lslices), tuple(rslices)
577 """Create (lshape, rshape, tuple(lslices), tuple(rslices)) such that
578 shapeof(x[lslices]) == shapeof(y[rslices]), where x is an array
589 lslices = [0]*ndim; rslices = [0]*ndim
612 rslices[n], lslices[n] = s_big, s_small
615 rslices[n], lslices[n] = s_small, s_big
617 return lshape, rshape, tuple(lslices), tuple(rslices)
711 def rslices(n, allow_empty=False):
759 genslices = rslices
1853 lslices, rslices = randslice_from_shape(ndim, shape)
1861 result = multislice_assign(lst, lst, lslices, rslices)
1867 nd[lslices] = nd[rslices]
1951 lshape, rshape, lslices, rslices = \
1962 xl[lslices] = xr[rslices]
1975 yl[lslices] = yr[rslices]
1992 zl[lslices] = zr[rslices]