From d29479e93370b577adeeb133116ced99dc4f81ff Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 5 Jan 2017 13:38:51 -0500 Subject: Refactor - Reorder includes - Unify reference style - Improve whitespace --- src/dependency_calculator.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dependency_calculator.h') diff --git a/src/dependency_calculator.h b/src/dependency_calculator.h index be6aeb7..93a751e 100644 --- a/src/dependency_calculator.h +++ b/src/dependency_calculator.h @@ -1,16 +1,16 @@ #ifndef DEPENDENCY_CALCULATOR_H #define DEPENDENCY_CALCULATOR_H -#include #include -#include +#include #include +#include #include "graph.h" class DependencyCalculator { public: - DependencyCalculator(const Graph &graph, int vertex) : graph_(graph), + DependencyCalculator(const Graph& graph, int vertex) : graph_(graph), vertex_(vertex) { init_(); find_shortest_paths_(); @@ -21,7 +21,7 @@ public: return dependency_.find(vertex)->second; } private: - const Graph &graph_; // (V, E) + const Graph& graph_; // (V, E) int vertex_; // s std::stack stack_; // S std::unordered_map> shortest_path_predecessors_; // P @@ -67,6 +67,7 @@ private: while (!stack_.empty()) { int vertex = stack_.top(); stack_.pop(); + for (int predecessor : shortest_path_predecessors_[vertex]) { double shortest_path_ratio = (double) shortest_paths_[predecessor] / -- cgit v1.2.3