diff options
Diffstat (limited to 'src/Nerve_GIC/test/test_GIC.cpp')
-rw-r--r-- | src/Nerve_GIC/test/test_GIC.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/src/Nerve_GIC/test/test_GIC.cpp b/src/Nerve_GIC/test/test_GIC.cpp index d7af7680..a8b1e7f7 100644 --- a/src/Nerve_GIC/test/test_GIC.cpp +++ b/src/Nerve_GIC/test/test_GIC.cpp @@ -28,51 +28,63 @@ #include <limits> #include <string> #include <vector> -#include <algorithm> // std::max +#include <algorithm> // std::max #include <gudhi/GIC.h> #include <gudhi/distance_functions.h> #include <gudhi/reader_utils.h> BOOST_AUTO_TEST_CASE(check_nerve) { - using Point = std::vector<float>; - Gudhi::cover_complex::Cover_complex<Point> N; N.set_type("Nerve"); - std::string cloud_file_name("data/cloud"); N.read_point_cloud(cloud_file_name); - std::string graph_file_name("data/graph"); N.set_graph_from_file(graph_file_name); - std::string cover_file_name("data/cover"); N.set_cover_from_file(cover_file_name); - N.find_simplices(); Gudhi::Simplex_tree<> stree; N.create_complex(stree); + Gudhi::cover_complex::Cover_complex<Point> N; + N.set_type("Nerve"); + std::string cloud_file_name("data/cloud"); + N.read_point_cloud(cloud_file_name); + std::string graph_file_name("data/graph"); + N.set_graph_from_file(graph_file_name); + std::string cover_file_name("data/cover"); + N.set_cover_from_file(cover_file_name); + N.find_simplices(); + Gudhi::Simplex_tree<> stree; + N.create_complex(stree); BOOST_CHECK(stree.num_vertices() == 3); - BOOST_CHECK((stree.num_simplices()-stree.num_vertices()) == 0); + BOOST_CHECK((stree.num_simplices() - stree.num_vertices()) == 0); BOOST_CHECK(stree.dimension() == 0); } BOOST_AUTO_TEST_CASE(check_GIC) { - using Point = std::vector<float>; - Gudhi::cover_complex::Cover_complex<Point> GIC; GIC.set_type("GIC"); - std::string cloud_file_name("data/cloud"); GIC.read_point_cloud(cloud_file_name); - std::string graph_file_name("data/graph"); GIC.set_graph_from_file(graph_file_name); - std::string cover_file_name("data/cover"); GIC.set_cover_from_file(cover_file_name); - GIC.find_simplices(); Gudhi::Simplex_tree<> stree; GIC.create_complex(stree); + Gudhi::cover_complex::Cover_complex<Point> GIC; + GIC.set_type("GIC"); + std::string cloud_file_name("data/cloud"); + GIC.read_point_cloud(cloud_file_name); + std::string graph_file_name("data/graph"); + GIC.set_graph_from_file(graph_file_name); + std::string cover_file_name("data/cover"); + GIC.set_cover_from_file(cover_file_name); + GIC.find_simplices(); + Gudhi::Simplex_tree<> stree; + GIC.create_complex(stree); BOOST_CHECK(stree.num_vertices() == 3); - BOOST_CHECK((stree.num_simplices()-stree.num_vertices()) == 4); + BOOST_CHECK((stree.num_simplices() - stree.num_vertices()) == 4); BOOST_CHECK(stree.dimension() == 2); } - BOOST_AUTO_TEST_CASE(check_voronoiGIC) { - using Point = std::vector<float>; - Gudhi::cover_complex::Cover_complex<Point> GIC; GIC.set_type("GIC"); - std::string cloud_file_name("data/cloud"); GIC.read_point_cloud(cloud_file_name); - std::string graph_file_name("data/graph"); GIC.set_graph_from_file(graph_file_name); - GIC.set_cover_from_Voronoi(Gudhi::Euclidean_distance(),2); - GIC.find_simplices(); Gudhi::Simplex_tree<> stree; GIC.create_complex(stree); + Gudhi::cover_complex::Cover_complex<Point> GIC; + GIC.set_type("GIC"); + std::string cloud_file_name("data/cloud"); + GIC.read_point_cloud(cloud_file_name); + std::string graph_file_name("data/graph"); + GIC.set_graph_from_file(graph_file_name); + GIC.set_cover_from_Voronoi(Gudhi::Euclidean_distance(), 2); + GIC.find_simplices(); + Gudhi::Simplex_tree<> stree; + GIC.create_complex(stree); BOOST_CHECK(stree.num_vertices() == 2); - BOOST_CHECK((stree.num_simplices()-stree.num_vertices()) == 1); + BOOST_CHECK((stree.num_simplices() - stree.num_vertices()) == 1); BOOST_CHECK(stree.dimension() == 1); } - |