Skip to content

Commit 6a65f61

Browse files
committed
resolved comments
1 parent d246c92 commit 6a65f61

7 files changed

Lines changed: 11 additions & 12 deletions

File tree

.clangd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CompileFlags:
88
- -Wextra
99
- -Wcast-align
1010
- -Wconversion
11+
- -Wsign-conversion
1112
- -Wunreachable-code
1213
- -Wuninitialized
1314
- -Wunused

include/gl/graph.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include "gl/io/stream_options_manipulator.hpp"
1111
#include "gl/util/ranges.hpp"
1212

13-
#include <sys/types.h>
14-
1513
#include <set>
1614

1715
namespace gl {

include/gl/impl/specialized/adjacency_matrix.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ struct undirected_adjacency_matrix {
277277
| std::views::filter([](auto edge_id) { return edge_id != invalid_id; })
278278
| std::ranges::to<std::vector>();
279279

280-
self._matrix.erase(self._matrix.begin() + static_cast<std::ptrdiff_t>(vertex_id));
280+
const auto vertex_pos = static_cast<std::ptrdiff_t>(vertex_id);
281+
self._matrix.erase(self._matrix.begin() + vertex_pos);
281282
for (auto& row : self._matrix)
282-
row.erase(row.begin() + static_cast<std::ptrdiff_t>(vertex_id));
283+
row.erase(row.begin() + vertex_pos);
283284

284285
return removed_edges;
285286
}

include/gl/impl/specialized/flat_adjacency_list.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "gl/decl/impl_tags.hpp"
99
#include "gl/graph_traits.hpp"
1010
#include "gl/impl/specialized/adjacency_list.hpp"
11-
#include "gl/types/core.hpp"
1211
#include "gl/types/flat_jagged_vector.hpp"
1312

1413
#include <algorithm>

include/hgl/impl/flat_incidence_list.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,10 @@ class flat_incidence_list<hgl::bf_directed_t, ImplTag> final {
495495
const id_type id, const Projection storage_proj
496496
) const noexcept {
497497
const auto idx = to_idx(id);
498-
if constexpr (std::same_as<Projection, std::identity>) {
498+
if constexpr (std::same_as<Projection, std::identity>)
499499
return util::concat(this->_tail_storage[idx], this->_head_storage[idx]);
500-
}
501-
else {
500+
else
502501
return (this->*storage_proj)[idx];
503-
}
504502
}
505503

506504
template <element_type Element>

include/hgl/impl/incidence_matrix.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#pragma once
66

7-
#include "gl/types/core.hpp"
87
#include "hgl/constants.hpp"
98
#include "hgl/decl/impl_tags.hpp"
109
#include "hgl/directional_tags.hpp"

tests/source/gl/test_graph.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,23 @@ struct test_graph {
8383
validate_full_graph_edges(graph);
8484
}
8585

86+
// clang-format off
87+
8688
template <gl::traits::c_instantiation_of<gl::graph> GraphType>
8789
void validate_full_graph_edges(const GraphType& graph) {
8890
REQUIRE(std::ranges::all_of(
8991
graph.vertex_ids(),
9092
[&graph, expected_n_edges = n_incident_edges_for_fully_connected_vertex(graph)](
9193
const gl::default_id_type vertex_id
9294
) {
93-
return static_cast<std::size_t>(gl::util::range_size(graph.adjacent_edges(vertex_id)
94-
))
95+
return static_cast<std::size_t>(gl::util::range_size(graph.adjacent_edges(vertex_id)))
9596
== expected_n_edges;
9697
}
9798
));
9899
}
99100

101+
// clang-format on
102+
100103
template <gl::traits::c_instantiation_of<gl::graph> GraphType>
101104
gl::size_type n_incident_edges_for_fully_connected_vertex(const GraphType& graph) {
102105
return graph.order() - 1uz;

0 commit comments

Comments
 (0)