Skip to content

Commit

Permalink
Fix include ordering and remove unused includes
Browse files Browse the repository at this point in the history
  • Loading branch information
kittobi1992 committed Dec 22, 2023
1 parent 8fee377 commit 0528632
Show file tree
Hide file tree
Showing 291 changed files with 648 additions and 1,102 deletions.
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ IncludeCategories:
- Regex: '^"mt-kahypar/utils'
Priority: 18
SortPriority: 6
- Regex: '^<libmtkahypar.h>'
Priority: 3
SortPriority: 2
- Regex: '^"gtest' # C++ headers.
Priority: 1
SortPriority: 0
- Regex: '^"gmock' # C++ headers.
Priority: 1
SortPriority: 0
- Regex: '^<' # C++ headers.
Priority: 2
SortPriority: 1
Expand Down
6 changes: 3 additions & 3 deletions include/helper_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

#pragma once

#include <string>
#include <sstream>

#include "libmtkahypartypes.h"
#include <string>

#include "mt-kahypar/partition/context.h"

#include "libmtkahypartypes.h"

using namespace mt_kahypar;

namespace lib {
Expand Down
3 changes: 1 addition & 2 deletions lib/examples/construct_graph.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
3 changes: 1 addition & 2 deletions lib/examples/construct_hypergraph.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
2 changes: 0 additions & 2 deletions lib/examples/improve_partition.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <memory>
#include <vector>
#include <iostream>
#include <thread>

Expand Down
4 changes: 2 additions & 2 deletions lib/examples/map_hypergraph_onto_target_graph.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>
#include <vector>

#include <libmtkahypar.h>

Expand Down
3 changes: 1 addition & 2 deletions lib/examples/partition_graph.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
3 changes: 1 addition & 2 deletions lib/examples/partition_hypergraph.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
3 changes: 1 addition & 2 deletions lib/examples/partition_with_fixed_vertices.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
3 changes: 1 addition & 2 deletions lib/examples/partition_with_individual_block_weights.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <memory>
#include <vector>
#include <iostream>
#include <memory>
#include <thread>

#include <libmtkahypar.h>
Expand Down
18 changes: 9 additions & 9 deletions lib/libmtkahypar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
******************************************************************************/

#include "include/libmtkahypar.h"
#include "include/libmtkahypartypes.h"
#include "include/helper_functions.h"

#include "tbb/parallel_for.h"

#include "include/helper_functions.h"
#include "include/libmtkahypartypes.h"

#include "mt-kahypar/definitions.h"
#include "mt-kahypar/partition/context.h"
#include "mt-kahypar/partition/partitioner_facade.h"
#include "mt-kahypar/partition/metrics.h"
#include "mt-kahypar/partition/conversion.h"
#include "mt-kahypar/partition/mapping/target_graph.h"
#include "mt-kahypar/parallel/tbb_initializer.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/io/hypergraph_factory.h"
#include "mt-kahypar/io/hypergraph_io.h"
#include "mt-kahypar/macros.h"
#include "mt-kahypar/partition/context.h"
#include "mt-kahypar/partition/conversion.h"
#include "mt-kahypar/partition/mapping/target_graph.h"
#include "mt-kahypar/partition/metrics.h"
#include "mt-kahypar/partition/partitioner_facade.h"
#include "mt-kahypar/utils/cast.h"
#include "mt-kahypar/utils/delete.h"
#include "mt-kahypar/utils/randomize.h"

#ifndef MT_KAHYPAR_DISABLE_BOOST
#include "mt-kahypar/io/command_line_options.h"
Expand Down
7 changes: 3 additions & 4 deletions mt-kahypar/application/mt_kahypar.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
#include "mt-kahypar/io/command_line_options.h"
#include "mt-kahypar/io/hypergraph_factory.h"
#include "mt-kahypar/io/partitioning_output.h"
#include "mt-kahypar/partition/partitioner_facade.h"
#include "mt-kahypar/partition/registries/register_memory_pool.h"
#include "mt-kahypar/partition/conversion.h"
#include "mt-kahypar/partition/mapping/target_graph.h"
#include "mt-kahypar/utils/cast.h"
#include "mt-kahypar/partition/partitioner_facade.h"
#include "mt-kahypar/partition/registries/register_memory_pool.h"
#include "mt-kahypar/utils/delete.h"
#include "mt-kahypar/utils/exception.h"
#include "mt-kahypar/utils/randomize.h"
#include "mt-kahypar/utils/utilities.h"
#include "mt-kahypar/utils/exception.h"

using namespace mt_kahypar;

Expand Down
5 changes: 2 additions & 3 deletions mt-kahypar/datastructures/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

#pragma once

#include <thread>
#include <memory>
#include <iterator>
#include <thread>

#include "tbb//parallel_invoke.h"
#include "tbb/parallel_for.h"
#include "tbb/scalable_allocator.h"
#include "tbb//parallel_invoke.h"

#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/memory_pool.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

#pragma once

#include <cmath>
#include <limits>

#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/utils/bit_ops.h"

namespace mt_kahypar {
namespace ds {
Expand Down
5 changes: 3 additions & 2 deletions mt-kahypar/datastructures/buffered_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
#pragma once

#include <vector>
#include <tbb/scalable_allocator.h>
#include <tbb/enumerable_thread_specific.h>

#include "tbb/enumerable_thread_specific.h"
#include "tbb/scalable_allocator.h"

namespace mt_kahypar::ds {

Expand Down
6 changes: 2 additions & 4 deletions mt-kahypar/datastructures/concurrent_bucket_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
#pragma once

#include <algorithm>
#include <thread>
#include <cmath>
#include <thread>

#include "tbb/task_arena.h"
#include "tbb/task_group.h"

#include "kahypar-resources/meta/mandatory.h"

#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"

namespace mt_kahypar {
namespace ds {
Expand Down
4 changes: 1 addition & 3 deletions mt-kahypar/datastructures/concurrent_flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
#pragma once

#include <algorithm>
#include <cmath>
#include <limits>
#include <utility>
#include <vector>
#include <cmath>

#include "kahypar-resources/macros.h"
#include "kahypar-resources/meta/mandatory.h"

#include "mt-kahypar/macros.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/connectivity_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

#include "tbb/parallel_invoke.h"

#include "mt-kahypar/datastructures/pin_count_in_part.h"
#include "mt-kahypar/datastructures/connectivity_set.h"
#include "mt-kahypar/datastructures/pin_count_in_part.h"
#include "mt-kahypar/datastructures/sparse_pin_counts.h"

namespace mt_kahypar {
Expand Down
10 changes: 2 additions & 8 deletions mt-kahypar/datastructures/connectivity_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,18 @@

#pragma once

#include <atomic>
#include <type_traits>
#include <limits>
#include <cassert>

#include "tbb/enumerable_thread_specific.h"

#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/datastructures/array.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/static_bitset.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/macros.h"
#include "mt-kahypar/utils/bit_ops.h"
#include "mt-kahypar/utils/memory_tree.h"
#include "mt-kahypar/utils/range.h"

#include "mt-kahypar/macros.h"
#include "hypergraph_common.h"

namespace mt_kahypar {
namespace ds {

Expand Down
8 changes: 3 additions & 5 deletions mt-kahypar/datastructures/contraction_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
#include "mt-kahypar/datastructures/contraction_tree.h"

#include <queue>

#include <tbb/parallel_reduce.h>
#include <tbb/parallel_invoke.h>
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_invoke.h>
#include <tbb/parallel_reduce.h>

#include "mt-kahypar/parallel/parallel_prefix_sum.h"
#include "mt-kahypar/datastructures/streaming_vector.h"
#include "mt-kahypar/utils/timer.h"
#include "mt-kahypar/parallel/parallel_prefix_sum.h"

namespace mt_kahypar {
namespace ds {
Expand Down
7 changes: 3 additions & 4 deletions mt-kahypar/datastructures/contraction_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

#pragma once

#include <tbb/parallel_for.h>
#include "tbb/parallel_for.h"

#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/datastructures/array.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/utils/memory_tree.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/utils/range.h"

namespace mt_kahypar {
Expand Down
12 changes: 2 additions & 10 deletions mt-kahypar/datastructures/delta_connectivity_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,13 @@

#pragma once

#include <atomic>
#include <type_traits>
#include <limits>
#include <cassert>

#include "tbb/enumerable_thread_specific.h"

#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/datastructures/array.h"
#include "mt-kahypar/datastructures/static_bitset.h"
#include "mt-kahypar/datastructures/connectivity_set.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/sparse_map.h"
#include "mt-kahypar/utils/range.h"
#include "mt-kahypar/datastructures/static_bitset.h"
#include "mt-kahypar/macros.h"
#include "mt-kahypar/utils/range.h"

namespace mt_kahypar {
namespace ds {
Expand Down
9 changes: 2 additions & 7 deletions mt-kahypar/datastructures/delta_partitioned_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@

#pragma once

#include <atomic>
#include <type_traits>

#include "kahypar-resources/meta/mandatory.h"

#include "mt-kahypar/datastructures/connectivity_set.h"
#include "mt-kahypar/datastructures/delta_connectivity_set.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/sparse_map.h"
#include "mt-kahypar/datastructures/delta_connectivity_set.h"
#include "mt-kahypar/datastructures/connectivity_set.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/partition/context.h"
#include "mt-kahypar/utils/exception.h"

namespace mt_kahypar {
namespace ds {
Expand Down
5 changes: 1 addition & 4 deletions mt-kahypar/datastructures/delta_partitioned_hypergraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@

#pragma once

#include <atomic>
#include <type_traits>

#include "kahypar-resources/meta/mandatory.h"

#include "mt-kahypar/datastructures/delta_connectivity_set.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/sparse_map.h"
#include "mt-kahypar/datastructures/delta_connectivity_set.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/partition/context.h"

Expand Down
1 change: 1 addition & 0 deletions mt-kahypar/datastructures/dynamic_adjacency_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/parallel/parallel_prefix_sum.h"
#include "mt-kahypar/datastructures/streaming_vector.h"

namespace mt_kahypar {
namespace ds {
Expand Down
8 changes: 3 additions & 5 deletions mt-kahypar/datastructures/dynamic_adjacency_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@

#include "kahypar-resources/datastructure/fast_reset_flag_array.h"

#include "mt-kahypar/macros.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/streaming_vector.h"
#include "mt-kahypar/datastructures/array.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/parallel/stl/scalable_unique_ptr.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/utils/range.h"

namespace mt_kahypar {
Expand Down
Loading

0 comments on commit 0528632

Please sign in to comment.