Skip to content

Commit

Permalink
:octocat: Applied clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
pratzl authored and github-actions[bot] committed Nov 16, 2023
1 parent ace0598 commit 5ccf559
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 61 deletions.
22 changes: 11 additions & 11 deletions include/graph/container/compressed_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class csr_row_values<EV, void, GV, VId, EIndex, Alloc> {
using value_type = void;
using size_type = size_t; //VId;

public: // Properties
public: // Properties
[[nodiscard]] constexpr size_type size() const noexcept { return 0; }
[[nodiscard]] constexpr bool empty() const noexcept { return true; }
[[nodiscard]] constexpr size_type capacity() const noexcept { return 0; }
Expand Down Expand Up @@ -342,7 +342,7 @@ class csr_col_values<void, VV, GV, VId, EIndex, Alloc> {
using value_type = void;
using size_type = size_t; //VId;

public: // Properties
public: // Properties
[[nodiscard]] constexpr size_type size() const noexcept { return 0; }
[[nodiscard]] constexpr bool empty() const noexcept { return true; }
[[nodiscard]] constexpr size_type capacity() const noexcept { return 0; }
Expand Down Expand Up @@ -481,7 +481,7 @@ class compressed_graph_base
}

public:
public: // Operations
public: // Operations
void reserve_vertices(size_type count) {
row_index_.reserve(count + 1); // +1 for terminating row
row_values_base::reserve(count);
Expand Down Expand Up @@ -742,27 +742,27 @@ class compressed_graph_base
#if VERTICES_CPO
friend constexpr vertices_type vertices(compressed_graph_base& g) {
if (g.row_index_.empty())
return vertices_type(g.row_index_); // really empty
return vertices_type(g.row_index_); // really empty
else
return vertices_type(g.row_index_.begin(), g.row_index_.end() - 1); // don't include terminating row
}
friend constexpr const_vertices_type vertices(const compressed_graph_base& g) {
if (g.row_index_.empty())
return const_vertices_type(g.row_index_); // really empty
return const_vertices_type(g.row_index_); // really empty
else
return const_vertices_type(g.row_index_.begin(), g.row_index_.end() - 1); // don't include terminating row
}
#else
friend constexpr vertices_type tag_invoke(::std::graph::tag_invoke::vertices_fn_t, compressed_graph_base& g) {
if (g.row_index_.empty())
return vertices_type(g.row_index_); // really empty
return vertices_type(g.row_index_); // really empty
else
return vertices_type(g.row_index_.begin(), g.row_index_.end() - 1); // don't include terminating row
}
friend constexpr const_vertices_type tag_invoke(::std::graph::tag_invoke::vertices_fn_t,
const compressed_graph_base& g) {
if (g.row_index_.empty())
return const_vertices_type(g.row_index_); // really empty
return const_vertices_type(g.row_index_); // really empty
else
return const_vertices_type(g.row_index_.begin(), g.row_index_.end() - 1); // don't include terminating row
}
Expand All @@ -776,15 +776,15 @@ class compressed_graph_base
friend constexpr edges_type edges(graph_type& g, vertex_type& u) {
static_assert(ranges::contiguous_range<row_index_vector>, "row_index_ must be a contiguous range to get next row");
vertex_type* u2 = &u + 1;
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u.index) <= g.col_index_.size() &&
static_cast<size_t>(u2->index) <= g.col_index_.size()); // in col_index_ bounds?
return edges_type(g.col_index_.begin() + u.index, g.col_index_.begin() + u2->index);
}
friend constexpr const_edges_type edges(const graph_type& g, const vertex_type& u) {
static_assert(ranges::contiguous_range<row_index_vector>, "row_index_ must be a contiguous range to get next row");
const vertex_type* u2 = &u + 1;
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u.index) <= g.col_index_.size() &&
static_cast<size_t>(u2->index) <= g.col_index_.size()); // in col_index_ bounds?
return const_edges_type(g.col_index_.begin() + u.index, g.col_index_.begin() + u2->index);
Expand All @@ -806,7 +806,7 @@ class compressed_graph_base
friend constexpr edges_type tag_invoke(::std::graph::tag_invoke::edges_fn_t, graph_type& g, vertex_type& u) {
static_assert(ranges::contiguous_range<row_index_vector>, "row_index_ must be a contiguous range to get next row");
vertex_type* u2 = &u + 1;
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u.index) <= g.col_index_.size() &&
static_cast<size_t>(u2->index) <= g.col_index_.size()); // in col_index_ bounds?
return edges_type(g.col_index_.begin() + u.index, g.col_index_.begin() + u2->index);
Expand All @@ -815,7 +815,7 @@ class compressed_graph_base
tag_invoke(::std::graph::tag_invoke::edges_fn_t, const graph_type& g, const vertex_type& u) {
static_assert(ranges::contiguous_range<row_index_vector>, "row_index_ must be a contiguous range to get next row");
const vertex_type* u2 = &u + 1;
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u2 - &u) < g.row_index_.size()); // in row_index_ bounds?
assert(static_cast<size_t>(u.index) <= g.col_index_.size() &&
static_cast<size_t>(u2->index) <= g.col_index_.size()); // in col_index_ bounds?
return const_edges_type(g.col_index_.begin() + u.index, g.col_index_.begin() + u2->index);
Expand Down
4 changes: 2 additions & 2 deletions include/graph/container/dynamic_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ class dynamic_graph_base {
constexpr typename vertices_type::value_type& operator[](size_type i) noexcept { return vertices_[i]; }
constexpr const typename vertices_type::value_type& operator[](size_type i) const noexcept { return vertices_[i]; }

public: // Operations
public: // Operations
void reserve_vertices(size_type count) {
if constexpr (reservable<vertices_type>) // reserve if we can; otherwise ignored
vertices_.reserve(count);
Expand Down Expand Up @@ -1631,7 +1631,7 @@ class dynamic_graph : public dynamic_graph_base<EV, VV, GV, VId, Sourced, Traits
private:
value_type value_; ///< Graph value

private: // tag_invoke properties
private: // tag_invoke properties
friend constexpr value_type& graph_value(graph_type& g) { return g.value_; }
friend constexpr const value_type& graph_value(const graph_type& g) { return g.value_; }
};
Expand Down
Loading

0 comments on commit 5ccf559

Please sign in to comment.