36 #include <ringmesh/ringmesh_tests_config.h> 49 template < index_t DIMENSION >
52 std::vector< vecn< DIMENSION > > hardcoded_unique_vertices( 4 );
53 for( index_t p :
range( hardcoded_unique_vertices.size() ) )
56 for( index_t i :
range( DIMENSION ) )
62 std::vector< vecn< DIMENSION > > vertices( 7 );
63 vertices[0] = hardcoded_unique_vertices[0];
64 vertices[1] = hardcoded_unique_vertices[1];
65 vertices[2] = hardcoded_unique_vertices[0];
66 vertices[3] = hardcoded_unique_vertices[2];
67 vertices[4] = hardcoded_unique_vertices[1];
68 vertices[5] = hardcoded_unique_vertices[3];
69 vertices[6] = hardcoded_unique_vertices[0];
71 std::vector< index_t > hardcoded_index_map( 7 );
73 hardcoded_index_map[0] = 0;
74 hardcoded_index_map[1] = 1;
75 hardcoded_index_map[2] = 0;
76 hardcoded_index_map[3] = 2;
77 hardcoded_index_map[4] = 1;
78 hardcoded_index_map[5] = 3;
79 hardcoded_index_map[6] = 0;
82 std::vector< vecn< DIMENSION > > unique_vertices;
83 std::vector< index_t > index_map;
84 std::tie( std::ignore, index_map, unique_vertices ) =
87 for( index_t i :
range( index_map.size() ) )
89 if( index_map[i] != hardcoded_index_map[i] )
95 for( index_t v :
range( unique_vertices.size() ) )
97 if( unique_vertices[v] != hardcoded_unique_vertices[v] )
100 "TEST",
"Unique vertices found are wrong" );
112 test_nn_search< 2 >();
114 test_nn_search< 3 >();
121 catch(
const std::exception& e )
GEO::vecng< DIMENSION, double > vecn
static void err(const std::string &feature, const Args &... args)
static void out(const std::string &feature, const Args &... args)
const std::string & category() const
Classes to build GeoModel from various inputs.
std::tuple< index_t, std::vector< index_t >, std::vector< vecn< DIMENSION > > > get_colocated_index_mapping_and_unique_points(double epsilon) const
Gets the index_map that link all the points to a no duplicated list of index in the list of unique_po...
void RINGMESH_API default_configure()