@@ -23,11 +23,11 @@ limitations under the License.
2323#include < string>
2424#include < vector>
2525
26+ #include " osp/auxiliary/io/bsp_schedule_file_writer.hpp"
27+ #include " osp/auxiliary/io/general_file_reader.hpp"
2628#include " osp/auxiliary/misc.hpp"
2729#include " osp/graph_algorithms/directed_graph_path_util.hpp"
2830#include " osp/graph_implementations/adj_list_impl/computational_dag_edge_idx_vector_impl.hpp"
29- #include " osp/auxiliary/io/bsp_schedule_file_writer.hpp"
30- #include " osp/auxiliary/io/general_file_reader.hpp"
3131
3232using namespace osp ;
3333
@@ -46,20 +46,14 @@ void add_graph_stats(const ComputationalDag &graph, std::ofstream &outfile) {
4646
4747 edge_lengths.emplace (diff);
4848 sum_edge_length += diff;
49- if (diff == 1 ) {
50- short_edges += 1 ;
51- }
49+ if (diff == 1 ) { short_edges += 1 ; }
5250 }
5351 unsigned median_edge_length = 0 ;
54- if (!edge_lengths.empty ()) {
55- median_edge_length = Get_Median (edge_lengths);
56- }
52+ if (!edge_lengths.empty ()) { median_edge_length = Get_Median (edge_lengths); }
5753
5854 Get_Median (edge_lengths);
5955
60- if (graph.num_edges () != 0 ) {
61- avg_edge_length = static_cast <float >(sum_edge_length) / static_cast <float >(graph.num_edges ());
62- }
56+ if (graph.num_edges () != 0 ) { avg_edge_length = static_cast <float >(sum_edge_length) / static_cast <float >(graph.num_edges ()); }
6357
6458 // Longest Path
6559 unsigned longest_path = 1 ;
@@ -77,9 +71,7 @@ void add_graph_stats(const ComputationalDag &graph, std::ofstream &outfile) {
7771 // Average bottom distance
7872 std::vector<unsigned > bot_level = get_bottom_node_distance (graph);
7973 size_t bot_level_sum = 0 ;
80- for (size_t i = 0 ; i < bot_level.size (); i++) {
81- bot_level_sum += bot_level[i];
82- }
74+ for (size_t i = 0 ; i < bot_level.size (); i++) { bot_level_sum += bot_level[i]; }
8375 float avg_bot_level = static_cast <float >(bot_level_sum) / static_cast <float >(bot_level.size ());
8476
8577 // // Number of Triangles
@@ -151,22 +143,20 @@ int main(int argc, char *argv[]) {
151143 << std::endl;
152144
153145 for (const auto &dirEntry : std::filesystem::recursive_directory_iterator (graph_dir)) {
154- if (std::filesystem::is_directory (dirEntry))
155- continue ;
146+ if (std::filesystem::is_directory (dirEntry)) { continue ; }
156147
157148 std::cout << " Processing: " << dirEntry << std::endl;
158149
159150 std::string path_str = dirEntry.path ();
160-
151+
161152 ComputationalDag graph;
162153 bool status = file_reader::readGraph (dirEntry.path (), graph);
163154 if (!status) {
164155 std::cout << " Failed to read graph\n " ;
165156 return 1 ;
166- }
157+ }
167158
168- if (!status)
169- continue ;
159+ if (!status) { continue ; }
170160
171161 std::string graph_name = path_str.substr (path_str.rfind (" /" ) + 1 );
172162 graph_name = graph_name.substr (0 , graph_name.rfind (" ." ));
@@ -177,4 +167,4 @@ int main(int argc, char *argv[]) {
177167 }
178168
179169 return 0 ;
180- }
170+ }
0 commit comments