Skip to content

Commit 0780f43

Browse files
committed
Apply recommended changes from Copilot to compressed_graph
1 parent dd4764c commit 0780f43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/graph/container/compressed_graph.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ class compressed_graph_base
532532

533533
void resize_vertices(size_type count) {
534534
row_index_.resize(count + 1); // +1 for terminating row
535-
row_values_resize(count);
535+
row_values_base::resize(count);
536536
}
537537
void resize_edges(size_type count) {
538538
col_index_.reserve(count);
@@ -562,7 +562,7 @@ class compressed_graph_base
562562
/**
563563
* Load vertex values, callable either before or after @c load_edges(erng,eproj).
564564
*
565-
* If @c load_edges(vrng,vproj) has been called before this, the @c row_values_ vector will be
565+
* If @c load_vertices(vrng,vproj) has been called before this, the @c row_values_ vector will be
566566
* extended to match the number of @c row_index_.size()-1 to avoid out-of-bounds errors when
567567
* accessing vertex values.
568568
*
@@ -703,7 +703,7 @@ class compressed_graph_base
703703
std::string msg = std::format(
704704
"source id of {} on line {} of the data input is not ordered after source id of {} on the previous line",
705705
edge.source_id, debug_count, last_uid);
706-
std::cout << std::format("\n{}\n", msg);
706+
//std::cout << std::format("\n{}\n", msg);
707707
assert(false);
708708
throw graph_error(move(msg));
709709
}
@@ -736,7 +736,7 @@ class compressed_graph_base
736736
* See @c load_edges() and @c load_vertices() for more information.
737737
*
738738
* @tparam EProj Edge Projection Function type
739-
* @tparam VProj Vertex Projectiong Function type
739+
* @tparam VProj Vertex Projection Function type
740740
* @tparam ERng Edge Range type
741741
* @tparam VRng Vertex Range type
742742
* @tparam PartRng Range of starting vertex Ids for each partition
@@ -824,7 +824,7 @@ class compressed_graph_base
824824
}
825825
friend constexpr bool has_edge(const compressed_graph_base& g) { return g.col_index_.size() > 0; }
826826

827-
friend vertex_id_type vertex_id(const compressed_graph_base& g, const_iterator ui) {
827+
friend constexpr vertex_id_type vertex_id(const compressed_graph_base& g, const_iterator ui) {
828828
return static_cast<vertex_id_type>(ui - g.row_index_.begin());
829829
}
830830

@@ -881,7 +881,7 @@ class compressed_graph_base
881881

882882
friend constexpr auto num_vertices(const compressed_graph_base& g, partition_id_type pid) {
883883
assert(static_cast<size_t>(pid) < g.partition_.size() - 1);
884-
g.partition_[pid + 1] - g.partition_[pid];
884+
return g.partition_[pid + 1] - g.partition_[pid];
885885
}
886886

887887
friend constexpr auto vertices(const compressed_graph_base& g, partition_id_type pid) {

0 commit comments

Comments
 (0)