Rectangles
A collection of tools for dealing with n-dimensional boxes.
Functions:
|
Input: - base, an array (M0 x M1 x M2...Mn) - indices, an array (S x n) - value |
|
Input - st n-tensor - en n-tensor - pts (batch x n) - left_closed = True - right_closed = False |
|
Input: - base, an array (M0 x M1 x M2...Mn) - indices, an array (S x n) - vals, an array (S) |
|
Given a tensor F indicating the value of a function from st1 to st1+F.shape |
|
Given a tensor F indicating the value of a function from (0,0,...) to F.shape |
- bardensr.rectangles.fill_ignoreoob(base, indices, value)
Input: - base, an array (M0 x M1 x M2…Mn) - indices, an array (S x n) - value
Sets base[indices[i]]=value, but if indices[i] is oob it is ignored
- bardensr.rectangles.pointcloud_in_box_test(pts, st, en, left_closed=True, right_closed=False)
Input - st n-tensor - en n-tensor - pts (batch x n) - left_closed = True - right_closed = False
Output: boolean indicating which pts fall inside box defined by
prod_i [st[i],en[i])
left_closed and right_closed control the kinds of intervals considered, i.e.
True,False –> prod_i [st[i],en[i]) True,True –> prod_i [st[i],en[i]] False,False –> prod_i (st[i],en[i]) False,True –> prod_i (st[i],en[i]]
- bardensr.rectangles.scatter_ignoreoob(base, indices, values)
Input: - base, an array (M0 x M1 x M2…Mn) - indices, an array (S x n) - vals, an array (S)
Sets base[indices[i]]=vals[i], but if indices[i] is oob it is ignored
- bardensr.rectangles.sliceit(F, st1, st2, en2, fill_value=0.0)
Given a tensor F indicating the value of a function from st1 to st1+F.shape
find it’s slice from st2 to en2, filling with “fill_value” if necessary.
- bardensr.rectangles.sliceit0(F, st2, en2, fill_value=0.0)
Given a tensor F indicating the value of a function from (0,0,…) to F.shape
find it’s slice from st2 to en2, filling with “fill_value” if necessary.