Neighbours
- hypertiling.neighbors.find_radius_brute_force(tiling, radius=None, eps=1e-05) List[List[int]]
Get adjacent polygons for the entire tiling through radius search This algorithm works in a brute-force manner, the distances between every pair of cells are compared against the search radius.
Time complexity: O(n^2) where n=len(tiling) Slow, use only for small tilings or for debugging purposes
Arguments:
- tilingsub-class of Tiling
The hyperbolic tiling object (represented by one of the “kernels”)
- radiusfloat
The search radius
- epsfloat
Add small value to search radius to avoid rounding issues
Returns:
List[List[int]] containing neighbour indices of every cell.
- hypertiling.neighbors.find_radius_optimized(tiling, radius=None, eps=1e-05) List[List[int]]
Get adjacent polygons for the entire tiling through radius search Compared to its brute-force equivalent, this improved implemention makes sure everything is fully vectorized and complied by numpy, such that we gain a dramatic speed-up
Time complexity: O(n^2) where n=len(tiling)
Arguments:
- tilingsub-class of Tiling
The hyperbolic tiling object (represented by one of the “kernels”)
- radiusfloat
The search radius
- epsfloat
Add small value to search radius to avoid rounding issues
Returns:
List[List[int]] containing neighbour indices of every cell.
- hypertiling.neighbors.find_radius_optimized_single(tiling, index, radius=None, eps=1e-05) List[int]
Get adjacent polygons for a single polygon through radius search Compared to its brute-force equivalent, this improved implemention makes sure everything is fully vectorized and complied by numpy, such that we gain a dramatic speed-up
Time complexity: O(n) where n=len(tiling)
Arguments:
- tilingsub-class of Tiling
The hyperbolic tiling object (represented by one of the “kernels”)
- indexint
Index of the cell for which the neighbours are to be found
- radiusfloat
The search radius
- epsfloat
Add small value to search radius to avoid rounding issues
Returns:
[List[int]] containing neighbour indices of every cell.