Medusa  1.1
Coordinate Free Mehless Method implementation
test/spatial_search/KDGrid_test.cpp
#include "gtest/gtest.h"
namespace mm {
TEST(KDGrid, 2D) {
KDGrid<Vec2d> search(0, 1, 0.1);
search.insert(Vec2d(0, 0));
search.insert(Vec2d(0.05, 0.19));
EXPECT_TRUE(search.existsPointInSphere(0.0, 1.0));
EXPECT_FALSE(search.existsPointInSphere(1.0, 1.0));
}
TEST(KDGrid, 3D) {
KDGrid<Vec2d> search(0, 1, 0.1);
EXPECT_FALSE(search.existsPointInSphere(0.0, 1.0));
search.insert(Vec2d(0, 0));
EXPECT_TRUE(search.existsPointInSphere(0.0, 1.0));
EXPECT_FALSE(search.existsPointInSphere(1.0, 1.0));
}
TEST(KDGrid, Usage) {
KDGrid<Vec2d> search(0, 1, 0.1);
search.insert(Vec2d(0, 0));
if (search.existsPointInSphere(0.0, 1.0)) {
// do sth ...
}
std::cout << search << std::endl;
}
} // namespace mm
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
KDGrid_fwd.hpp
Vec.hpp
mm::Vec2d
Vec< double, 2 > Vec2d
Convenience typedef for 2d vector of doubles.
Definition: Vec_fwd.hpp:34