@@ -134,7 +134,7 @@ class FilterAABB {
134134 ScalarInternal node_min_bits = MAX_MASK<ScalarInternal> << bits_to_ignore;
135135 ScalarInternal node_max_bits = ~node_min_bits;
136136
137- for (size_t i = 0 ; i < prefix. size () ; ++i) {
137+ for (dimension_t i = 0 ; i < DIM ; ++i) {
138138 if ((prefix[i] | node_max_bits) < min_internal_[i] ||
139139 (prefix[i] & node_min_bits) > max_internal_[i]) {
140140 return false ;
@@ -154,13 +154,17 @@ class FilterAABB {
154154/*
155155 * The sphere filter can be used to query a point tree for a sphere.
156156 */
157- template <typename CONVERTER = ConverterIEEE<3 >, typename DISTANCE = DistanceEuclidean<3 >>
157+ template <
158+ typename CONVERTER = ConverterIEEE<3 >,
159+ typename DISTANCE = DistanceEuclidean<CONVERTER::DimInternal>>
158160class FilterSphere {
159161 using KeyExternal = typename CONVERTER::KeyExternal;
160162 using KeyInternal = typename CONVERTER::KeyInternal;
161163 using ScalarInternal = typename CONVERTER::ScalarInternal;
162164 using ScalarExternal = typename CONVERTER::ScalarExternal;
163165
166+ static constexpr auto DIM = CONVERTER::DimInternal;
167+
164168 public:
165169 FilterSphere (
166170 const KeyExternal& center,
@@ -194,7 +198,7 @@ class FilterSphere {
194198 ScalarInternal node_max_bits = ~node_min_bits;
195199
196200 KeyInternal closest_in_bounds;
197- for (size_t i = 0 ; i < prefix. size () ; ++i) {
201+ for (dimension_t i = 0 ; i < DIM ; ++i) {
198202 // calculate lower and upper bound for dimension for given node
199203 ScalarInternal lo = prefix[i] & node_min_bits;
200204 ScalarInternal hi = prefix[i] | node_max_bits;
0 commit comments