Skip to content

Commit 2491366

Browse files
committed
Fix: Minor changes
1 parent 4dcf016 commit 2491366

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/dodgr.dll

1.52 KB
Binary file not shown.

src/graph.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ size_t graph::identify_graph_components (vertex_map_t &v,
192192
//' @param index used to execute algoritm
193193
//' @param compnum the current component number
194194
//' @noRd
195-
196195
void graph::strong_connect(vertex_id_t vt,
197196
vertex_map_t &v,
198197
std::unordered_map <vertex_id_t, size_t> &com,
@@ -299,15 +298,14 @@ size_t graph::identify_graph_strong_components (vertex_map_t &v,
299298
//' numbers
300299
//' @noRd
301300
// [[Rcpp::export]]
302-
303301
Rcpp::List rcpp_get_component_vector (const Rcpp::DataFrame &graph, bool strong = false)
304302
{
305303
vertex_map_t vertices;
306304
edge_map_t edge_map;
307305
vert2edge_map_t vert2edge_map;
308306

309307
bool has_times = graph::graph_from_df (graph, vertices, edge_map, vert2edge_map);
310-
has_times = false; // suppress unused variable warning
308+
has_times = false; // rm unused variable warning
311309

312310
std::unordered_map <vertex_id_t, size_t> components;
313311
size_t largest_component;
@@ -319,9 +317,9 @@ Rcpp::List rcpp_get_component_vector (const Rcpp::DataFrame &graph, bool strong
319317

320318
largest_component++; // suppress unused variable warning
321319

322-
// Map component numbers of vertices onto edges
320+
// Then map component numbers of vertices onto edges
323321
std::unordered_map <edge_id_t, size_t> comp_nums;
324-
for (auto &e : edge_map)
322+
for (auto e : edge_map)
325323
{
326324
vertex_id_t vi = e.second.get_from_vertex ();
327325
comp_nums.emplace (e.first, components.find(vi)->second);
@@ -330,7 +328,7 @@ Rcpp::List rcpp_get_component_vector (const Rcpp::DataFrame &graph, bool strong
330328
Rcpp::StringVector edge_id (comp_nums.size ());
331329
Rcpp::IntegerVector comp_num (comp_nums.size ());
332330
size_t i = 0;
333-
for (auto &cn: comp_nums)
331+
for (auto cn: comp_nums)
334332
{
335333
edge_id (i) = cn.first;
336334
comp_num (i) = static_cast <int> (cn.second) + 1L; // 1-indexed for R

0 commit comments

Comments
 (0)