in_quadtree
in_quadtree(point, C, W, CH)
Find quadtree cell containing point
Traverses a quadtree in logarithmic time to find the smallest cell (and every other cell) containing a given point in 2D space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point |
numpy double array
|
Query point coordinates |
required |
C |
numpy double array
|
Matrix of cell centers |
required |
W |
numpy double array
|
Vector of half cell widths |
required |
CH |
numpy int array
|
Matrix of child indices (-1 if leaf node) |
required |
Returns:
Name | Type | Description |
---|---|---|
i |
int
|
Index of smallest cell containint P into C,W,CH (-1 means the point is not in the quadtree) |
others |
numpy int array
|
others vector of integers to all other (non-leaf) cells containing P |
See Also
initialize_quadtree.
Notes
Only works for 2D quadtree. 3D functionality is coming soon.
Examples:
TO-DO
Source code in src/gpytoolbox/in_quadtree.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|