@@ -306,6 +306,29 @@ TEST_CASE_FIXTURE(
306306 CHECK_FALSE (sut.are_bound (constants::id2, constants::id1));
307307}
308308
309+ TEST_CASE_FIXTURE (
310+ test_undirected_vertex_major_incidence_matrix,
311+ " element size map getters should return maps of properly calculated element sizes"
312+ ) {
313+ constexpr auto n_elements = 5ull ;
314+ sut_type sut{n_elements, n_elements};
315+
316+ constexpr auto is_zero = [](const auto & size) { return size == 0ull ; };
317+ REQUIRE (std::ranges::all_of (sut.degree_map (n_elements), is_zero));
318+ REQUIRE (std::ranges::all_of (sut.hyperedge_size_map (n_elements), is_zero));
319+
320+ for (std::size_t i = 0uz; i < n_elements; i++)
321+ for (std::size_t j = 0uz; j <= i; j++)
322+ sut.bind (i, j);
323+
324+ const auto deg_map = sut.degree_map (n_elements);
325+ const auto esize_map = sut.hyperedge_size_map (n_elements);
326+ for (std::size_t i = 0uz; i < n_elements; i++) {
327+ CHECK_EQ (deg_map[i], i + 1uz);
328+ CHECK_EQ (esize_map[i], n_elements - i);
329+ }
330+ }
331+
309332struct test_undirected_hyperedge_major_incidence_matrix : public test_incidence_matrix {
310333 using sut_type = hgl::impl::incidence_matrix<hgl::undirected_t , hgl::impl::hyperedge_major_t >;
311334};
@@ -583,6 +606,29 @@ TEST_CASE_FIXTURE(
583606 CHECK_FALSE (sut.are_bound (constants::id2, constants::id1));
584607}
585608
609+ TEST_CASE_FIXTURE (
610+ test_undirected_hyperedge_major_incidence_matrix,
611+ " element size map getters should return maps of properly calculated element sizes"
612+ ) {
613+ constexpr auto n_elements = 5ull ;
614+ sut_type sut{n_elements, n_elements};
615+
616+ constexpr auto is_zero = [](const auto & size) { return size == 0ull ; };
617+ REQUIRE (std::ranges::all_of (sut.degree_map (n_elements), is_zero));
618+ REQUIRE (std::ranges::all_of (sut.hyperedge_size_map (n_elements), is_zero));
619+
620+ for (std::size_t i = 0uz; i < n_elements; i++)
621+ for (std::size_t j = 0uz; j <= i; j++)
622+ sut.bind (i, j);
623+
624+ const auto deg_map = sut.degree_map (n_elements);
625+ const auto esize_map = sut.hyperedge_size_map (n_elements);
626+ for (std::size_t i = 0uz; i < n_elements; i++) {
627+ CHECK_EQ (deg_map[i], i + 1uz);
628+ CHECK_EQ (esize_map[i], n_elements - i);
629+ }
630+ }
631+
586632struct test_bf_directed_incidence_matrix : public test_incidence_matrix {
587633 template <typename SutType>
588634 auto is_incident_pred () {
0 commit comments