@@ -1047,6 +1047,18 @@ def nearest(
1047
1047
return self ._get_ids (it , p_num_results .contents .value )
1048
1048
1049
1049
def intersection_v (self , mins , maxs ):
1050
+ """Bulk intersection query for obtaining the ids of entries
1051
+ which intersect with the provided bounding boxes. The return
1052
+ value is a tuple consisting of two 1D NumPy arrays: one of
1053
+ intersecting ids and another containing the counts for each
1054
+ bounding box.
1055
+
1056
+ :param mins: A NumPy array of shape `(n, d)` containing the
1057
+ minima to query.
1058
+
1059
+ :param maxs: A NumPy array of shape `(n, d)` containing the
1060
+ maxima to query.
1061
+ """
1050
1062
import numpy as np
1051
1063
1052
1064
assert mins .shape == maxs .shape
@@ -1102,6 +1114,34 @@ def nearest_v(
1102
1114
strict = False ,
1103
1115
return_max_dists = False ,
1104
1116
):
1117
+ """Bulk ``k``-nearest query for the given bounding boxes. The
1118
+ return value is a tuple consisting of, by default, two 1D NumPy
1119
+ arrays: one of intersecting ids and another containing the
1120
+ counts for each bounding box.
1121
+
1122
+ :param mins: A NumPy array of shape `(n, d)` containing the
1123
+ minima to query.
1124
+
1125
+ :param maxs: A NumPy array of shape `(n, d)` containing the
1126
+ maxima to query.
1127
+
1128
+ :param num_results: The maximum number of neighbors to return
1129
+ for each bounding box. If there are multiple equidistant
1130
+ furthest neighbors then, by default, they are *all*
1131
+ returned. Hence, the actual number of results can be
1132
+ greater than requested.
1133
+
1134
+ :param max_dists: Optional; a NumPy array of shape `(n,)`
1135
+ containing the maximum distance to consider for each
1136
+ bounding box.
1137
+
1138
+ :param strict: If True then each point will never return more
1139
+ than `num_results` even in cases of equidistant furthest
1140
+ neighbors.
1141
+
1142
+ :param return_max_dists: If True, the distance of the furthest
1143
+ neighbor for each bounding box will also be returned.
1144
+ """
1105
1145
import numpy as np
1106
1146
1107
1147
assert mins .shape == maxs .shape
0 commit comments