Skip to content

Commit 058c09f

Browse files
Apply automatic code formatting
1 parent e10955f commit 058c09f

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

cpp/open3d/core/nns/KnnIndex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class KnnIndex : public NNSIndex {
4747

4848
/// \brief Parameterized Constructor.
4949
///
50-
/// \param dataset_points Provides a set of data points as Tensor for nearest
51-
/// neighbor search. CPU tensors use NanoFlann through
52-
/// open3d::core::nns::NearestNeighborSearch, while CUDA and SYCL tensors are
53-
/// handled by this class.
50+
/// \param dataset_points Provides a set of data points as Tensor for
51+
/// nearest neighbor search. CPU tensors use NanoFlann through
52+
/// open3d::core::nns::NearestNeighborSearch, while CUDA and SYCL tensors
53+
/// are handled by this class.
5454
KnnIndex(const Tensor& dataset_points);
5555
KnnIndex(const Tensor& dataset_points, const Dtype& index_dtype);
5656
~KnnIndex();

cpp/open3d/core/nns/NearestNeighborSearch.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ bool NearestNeighborSearch::FixedRadiusIndex(std::optional<double> radius) {
5252
} else {
5353
if (dataset_points_.IsSYCL()) {
5454
if (!radius.has_value()) {
55-
utility::LogError("radius is required for SYCL FixedRadiusIndex.");
55+
utility::LogError(
56+
"radius is required for SYCL FixedRadiusIndex.");
5657
}
5758
fixed_radius_index_.reset(new nns::FixedRadiusIndex());
58-
return fixed_radius_index_->SetTensorData(dataset_points_,
59-
radius.value(),
60-
index_dtype_);
59+
return fixed_radius_index_->SetTensorData(
60+
dataset_points_, radius.value(), index_dtype_);
6161
}
6262
return SetIndex();
6363
}
@@ -83,9 +83,8 @@ bool NearestNeighborSearch::HybridIndex(std::optional<double> radius) {
8383
utility::LogError("radius is required for SYCL HybridIndex.");
8484
}
8585
fixed_radius_index_.reset(new nns::FixedRadiusIndex());
86-
return fixed_radius_index_->SetTensorData(dataset_points_,
87-
radius.value(),
88-
index_dtype_);
86+
return fixed_radius_index_->SetTensorData(
87+
dataset_points_, radius.value(), index_dtype_);
8988
}
9089
return SetIndex();
9190
}

cpp/tests/core/KnnIndex.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ namespace open3d {
2525
namespace tests {
2626

2727
class KnnIndexPermuteDevices : public PermuteDevicesWithSYCL {};
28-
INSTANTIATE_TEST_SUITE_P(KnnIndex,
29-
KnnIndexPermuteDevices,
30-
testing::ValuesIn(KnnIndexPermuteDevices::TestCases()));
28+
INSTANTIATE_TEST_SUITE_P(
29+
KnnIndex,
30+
KnnIndexPermuteDevices,
31+
testing::ValuesIn(KnnIndexPermuteDevices::TestCases()));
3132

3233
TEST_P(KnnIndexPermuteDevices, KnnSearch) {
3334
// Define test data.
@@ -318,7 +319,8 @@ TEST_P(KnnIndexPermuteDevices, KnnSearchBatch) {
318319
EXPECT_EQ(indices.GetShape(), shape);
319320
EXPECT_EQ(distances.GetShape(), shape);
320321
EXPECT_TRUE(indices.AllClose(gt_indices)) << indices.ToString();
321-
EXPECT_TRUE(distances.AllClose(gt_distances, 1e-5, 1e-3)) << distances.ToString();
322+
EXPECT_TRUE(distances.AllClose(gt_distances, 1e-5, 1e-3))
323+
<< distances.ToString();
322324

323325
// int64
324326
// Set up Knn index.
@@ -342,7 +344,8 @@ TEST_P(KnnIndexPermuteDevices, KnnSearchBatch) {
342344
EXPECT_EQ(indices.GetShape(), shape);
343345
EXPECT_EQ(distances.GetShape(), shape);
344346
EXPECT_TRUE(indices.AllClose(gt_indices)) << indices.ToString();
345-
EXPECT_TRUE(distances.AllClose(gt_distances, 1e-5, 1e-3)) << distances.ToString();
347+
EXPECT_TRUE(distances.AllClose(gt_distances, 1e-5, 1e-3))
348+
<< distances.ToString();
346349
}
347350

348351
} // namespace tests

0 commit comments

Comments
 (0)