-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pragma once | ||
|
||
#include <torch_delaunay/triangle.h> | ||
#include <torch_delaunay/predicates.h> | ||
#include <torch_delaunay/triangle.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
find_package(Boost COMPONENTS unit_test_framework REQUIRED) | ||
|
||
# Define the c++ standard. | ||
add_definitions(-std=c++17) | ||
|
||
include_directories() | ||
|
||
|
||
file(GLOB torch_delaunay_TEST_SOURCES *.cc) | ||
|
||
foreach(torch_delaunay_TEST_SOURCE ${torch_delaunay_TEST_SOURCES}) | ||
# Extract extension from the file name. | ||
get_filename_component(torch_delaunay_TEST ${torch_delaunay_TEST_SOURCE} NAME_WE) | ||
|
||
add_executable(${torch_delaunay_TEST} ${torch_delaunay_TEST_SOURCE}) | ||
target_link_libraries(${torch_delaunay_TEST} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) | ||
target_link_libraries(${torch_delaunay_TEST} "${TORCH_LIBRARIES}") | ||
target_link_libraries(${torch_delaunay_TEST} torch_delaunay) | ||
|
||
# Define a new test from the source file. | ||
add_test(NAME ${torch_delaunay_TEST} COMMAND ${torch_delaunay_TEST}) | ||
endforeach(torch_delaunay_TEST_SOURCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MODULE quadtree | ||
|
||
#include <boost/test/included/unit_test.hpp> | ||
|
||
#include <torch_delaunay.h> | ||
|
||
|
||
using namespace torch_delaunay; | ||
|
||
|
||
BOOST_AUTO_TEST_SUITE(TestShull) | ||
|
||
|
||
BOOST_AUTO_TEST_CASE(test_shull2d) | ||
{ | ||
auto options = torch::TensorOptions().dtype(torch::kFloat64).device(torch::kCPU); | ||
auto points = torch::tensor({{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}, options); | ||
|
||
auto simplices = shull2d(points); | ||
|
||
BOOST_CHECK_EQUAL(simplices.sizes(), torch::IntArrayRef({1, 3})); | ||
} | ||
|
||
|
||
BOOST_AUTO_TEST_SUITE_END() |