fix GetAdjacendEdgeRange of matrix wrapper for tarjan scc and fix wrongly solved merge conflict

This commit is contained in:
Huyen Chau Nguyen
2015-08-19 19:44:11 +02:00
parent 78a8cf6982
commit 2de3fc9f6f
2 changed files with 11 additions and 12 deletions
+7 -7
View File
@@ -42,13 +42,13 @@ public:
return number_of_nodes_;
}
std::vector<EdgeWeight> GetAdjacentEdgeRange(const NodeID node) const {
std::vector<EdgeWeight> edges;
auto neq_invalid_edge_weight = [](EdgeWeight e){return (e != INVALID_EDGE_WEIGHT);};
std::copy_if(std::begin(table_),
std::end(table_),
std::back_inserter(edges),
neq_invalid_edge_weight);
std::vector<T> GetAdjacentEdgeRange(const NodeID node) const {
std::vector<T> edges;
for (auto i = 0; i < number_of_nodes_; ++i) {
if (*(std::begin(table_) + node * number_of_nodes_ + i) != INVALID_EDGE_WEIGHT) {
edges.push_back(i);
}
}
return edges;
}