Skip to content

Commit

Permalink
clean headers with iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Aug 5, 2024
1 parent 40cc5ed commit 8096009
Show file tree
Hide file tree
Showing 137 changed files with 1,354 additions and 604 deletions.
8 changes: 5 additions & 3 deletions include/htool/basic_types/tree.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef HTOOL_BASIC_TYPES_TREE_HPP
#define HTOOL_BASIC_TYPES_TREE_HPP
#include <memory>
#include <stack>
#include <vector>
#include <iterator> // for make_move_iterator
#include <memory> // for unique_ptr, make_shared, shared_ptr
#include <stack> // for stack
#include <utility> // for move, forward
#include <vector> // for vector

namespace htool {

Expand Down
22 changes: 11 additions & 11 deletions include/htool/basic_types/vector.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#ifndef HTOOL_BASIC_TYPES_VECTOR_HPP
#define HTOOL_BASIC_TYPES_VECTOR_HPP

#include "../misc/misc.hpp"
#include <algorithm>
#include <cassert>
#include <complex>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>
#include "../misc/misc.hpp" // for underlying_type
#include <algorithm> // for transform, max_element, min_element
#include <complex> // for complex, imag, real
#include <fstream> // ofstream
#include <functional> // for plus, minus
#include <iomanip> // for operator<<, setprecision
#include <iostream> // for operator<<, basic_ostream, ope...
#include <numeric> // for inner_product, accumulate
#include <string> // for operator<<, string, char_traits
#include <utility> // for pair
#include <vector> // for vector

namespace htool {
//================================//
Expand All @@ -33,7 +35,6 @@ std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {

template <typename T>
std::vector<T> operator+(const std::vector<T> &a, const std::vector<T> &b) {
assert(a.size() == b.size());
std::vector<T> result(a.size(), 0);
std::transform(a.begin(), a.end(), b.begin(), result.begin(), std::plus<T>());

Expand All @@ -48,7 +49,6 @@ std::vector<T> plus(const std::vector<T> &a, const std::vector<T> &b) {

template <typename T>
std::vector<T> operator-(const std::vector<T> &a, const std::vector<T> &b) {
assert(a.size() == b.size());
std::vector<T> result(a.size(), 0);
std::transform(a.begin(), a.end(), b.begin(), result.begin(), std::minus<T>());

Expand Down
19 changes: 8 additions & 11 deletions include/htool/clustering/cluster_node.hpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
#ifndef HTOOL_CLUSTERING_CLUSTER_NODE_HPP
#define HTOOL_CLUSTERING_CLUSTER_NODE_HPP

#include "../basic_types/tree.hpp"
#include "../misc/logger.hpp"
#include "../misc/misc.hpp"
#include "../misc/user.hpp"
#include "../basic_types/tree.hpp" // for TreeNode
#include "../misc/logger.hpp" // for Logger, LogLevel, LogLevel::ERROR
#include "../misc/misc.hpp" // for underlying_type
#include "cluster_tree_data.hpp"
#include <functional>
#include <memory>
#include <numeric>
#include <stack>
#include <vector>
#include <cstddef> // for size_t
#include <memory> // for make_shared, operator==
#include <numeric> // for iota
#include <string> // for basic_string
#include <vector> // for vector

namespace htool {

template <typename CoordinatesPrecision>
struct ClusterTreeData;
template <typename CoordinatesPrecision>
class Cluster : public TreeNode<Cluster<CoordinatesPrecision>, ClusterTreeData<CoordinatesPrecision>> {
protected:
Expand Down
23 changes: 12 additions & 11 deletions include/htool/clustering/cluster_output.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#ifndef HTOOL_CLUSTERING_CLUSTER_OUTPUT_HPP
#define HTOOL_CLUSTERING_CLUSTER_OUTPUT_HPP

#include "../misc/logger.hpp"
#include "../misc/user.hpp"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include "../misc/logger.hpp" // for Logger, LogLevel
#include "../misc/user.hpp" // for split, NbrToStr, StrToNbr
#include "htool/basic_types/tree.hpp" // for preorder_tree_traversal
#include "htool/clustering/cluster_node.hpp" // for Cluster, is_cluster_on_...
#include <algorithm> // for max, fill_n
#include <fstream> // for basic_ostream, operator<<
#include <iostream> // for cout
#include <iterator> // for distance
#include <stack> // for stack
#include <string> // for char_traits, basic_string
#include <utility> // for pair
#include <vector> // for vector

namespace htool {

template <typename CoordinatePrecision>
class Cluster;

template <typename CoordinatesPrecision>
void print(const Cluster<CoordinatesPrecision> &cluster) {
preorder_tree_traversal(
Expand Down
5 changes: 3 additions & 2 deletions include/htool/clustering/cluster_tree_data.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef HTOOL_CLUSTERING_CLUSTER_TREE_DATA_HPP
#define HTOOL_CLUSTERING_CLUSTER_TREE_DATA_HPP

#include <limits>
#include <vector>
#include <limits> // for numeric_limits
#include <memory> // for shared_ptr
#include <vector> // for vector

namespace htool {

Expand Down
13 changes: 10 additions & 3 deletions include/htool/clustering/tree_builder/direction_computation.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#ifndef HTOOL_CLUSTERING_TREE_BUILDER_DIRECTION_COMPUTATION_HPP
#define HTOOL_CLUSTERING_TREE_BUILDER_DIRECTION_COMPUTATION_HPP

#include "../../misc/evp.hpp"
#include "../../misc/logger.hpp"
#include "../cluster_node.hpp"
#include "../../misc/evp.hpp" // for solve_EVP_2, solve_EVP_3
#include "../../misc/logger.hpp" // for Logger, LogLevel
#include "htool/matrix/matrix.hpp" // for Matrix
#include <limits> // for numeric_limits
#include <string> // for basic_string
#include <vector> // for vector
namespace htool {
template <typename CoordinatePrecision>
class Cluster;
}

namespace htool {

Expand Down
18 changes: 13 additions & 5 deletions include/htool/clustering/tree_builder/recursive_build.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#ifndef HTOOL_CLUSTERING_TREE_BUILDER_HPP
#define HTOOL_CLUSTERING_TREE_BUILDER_HPP

#include "../../misc/evp.hpp"
#include "../../misc/logger.hpp"
#include "../cluster_node.hpp"
#include "../../basic_types/vector.hpp" // for norm2
#include "../../misc/logger.hpp" // for Logger, LogLevel
#include "../cluster_node.hpp" // for Cluster
#include "direction_computation.hpp"
#include "splitting.hpp"

#include <stack>
#include <algorithm> // for sort, transform
#include <cmath> // for pow, log, floor
#include <deque> // for deque
#include <functional> // for _1, bind, multiplies
#include <memory> // for shared_ptr, make_shared
#include <numeric> // for iota, inner_product
#include <stack> // for stack
#include <string> // for basic_string
#include <utility> // for pair
#include <vector> // for vector

namespace htool {

Expand Down
10 changes: 9 additions & 1 deletion include/htool/clustering/tree_builder/splitting.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#ifndef HTOOL_CLUSTERING_TREE_BUILDER_SPLITTING_HPP
#define HTOOL_CLUSTERING_TREE_BUILDER_SPLITTING_HPP

#include "../cluster_node.hpp"
#include "htool/basic_types/vector.hpp" // for dprod
#include <algorithm> // for max, all_of, find_if
#include <numeric> // for accumulate
#include <utility> // for pair
#include <vector> // for vector
namespace htool {
template <typename CoordinatePrecision>
class Cluster;
}

namespace htool {

Expand Down
24 changes: 18 additions & 6 deletions include/htool/distributed_operator/distributed_operator.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
#ifndef HTOOL_DISTRIBUTED_OPERATOR_HPP
#define HTOOL_DISTRIBUTED_OPERATOR_HPP

#include "../local_operators/local_hmatrix.hpp"
#include "../local_operators/virtual_local_operator.hpp"
#include "../misc/logger.hpp"
#include "../wrappers/wrapper_mpi.hpp"
#include "interfaces/partition.hpp"
#include <map>
#include "../misc/logger.hpp" // for Logger, LogLevel
#include "../misc/misc.hpp" // for conj_if_complex
#include "../misc/user.hpp" // for NbrToStr, StrToNbr
#include "../wrappers/wrapper_mpi.hpp" // for wrapper_mpi
#include <algorithm> // for fill, copy_n, fill_n, transform
#include <functional> // for plus
#include <map> // for map
#include <mpi.h> // for MPI_Comm_rank, MPI_Comm_size
#include <string> // for basic_string, operator<, string
#include <vector> // for vector
namespace htool {
template <class T>
class VirtualLocalOperator;
}
namespace htool {
template <typename CoefficientPrecision>
class IPartition;
}

namespace htool {
template <typename CoefficientPrecision>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef HTOOL_DISTRIBUTED_OPERATOR_PARTITION_FROM_CLUSTER_HPP
#define HTOOL_DISTRIBUTED_OPERATOR_PARTITION_FROM_CLUSTER_HPP

#include "../../clustering/cluster_node.hpp"
#include "../interfaces/partition.hpp"
#include "../../clustering/cluster_node.hpp" // for global_to_root_cluster
#include "../../misc/misc.hpp" // for underlying_type
#include "../interfaces/partition.hpp" // for IPartition

namespace htool {

Expand Down
22 changes: 18 additions & 4 deletions include/htool/distributed_operator/utility.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
#ifndef HTOOL_DISTRIBUTED_OPERATOR_UTILITY_HPP
#define HTOOL_DISTRIBUTED_OPERATOR_UTILITY_HPP

#include "../hmatrix/hmatrix_distributed_output.hpp"
#include "../local_operators/local_hmatrix.hpp"
#include "distributed_operator.hpp"
#include "implementations/partition_from_cluster.hpp"
#include "../hmatrix/hmatrix.hpp" // for HMatrix
#include "../hmatrix/interfaces/virtual_generator.hpp" // for GeneratorW...
#include "../hmatrix/tree_builder/tree_builder.hpp" // for HMatrixTre...
#include "../local_operators/local_hmatrix.hpp" // for LocalHMatrix
#include "../misc/misc.hpp" // for underlying...
#include "distributed_operator.hpp" // for Distribute...
#include "implementations/partition_from_cluster.hpp" // for PartitionF...
#include <functional> // for function
#include <mpi.h> // for MPI_Comm
namespace htool {
template <class T>
class VirtualLocalOperator;
}
namespace htool {
template <typename CoordinatesPrecision>
class Cluster;
}

namespace htool {

template <typename CoefficientPrecision, typename CoordinatePrecision = underlying_type<CoefficientPrecision>>
Expand Down
32 changes: 23 additions & 9 deletions include/htool/hmatrix/hmatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,29 @@
#if defined(_OPENMP)
# include <omp.h>
#endif
#include "../basic_types/tree.hpp"
#include "../clustering/cluster_node.hpp"
#include "../misc/logger.hpp"
#include "hmatrix_tree_data.hpp"
#include "interfaces/virtual_admissibility_condition.hpp"
#include "interfaces/virtual_dense_blocks_generator.hpp"
#include "interfaces/virtual_generator.hpp"
#include "lrmat/lrmat.hpp"
#include <queue>
#include "../basic_types/tree.hpp" // for Tree...
#include "../clustering/cluster_node.hpp" // for is_c...
#include "../misc/logger.hpp" // for Logger
#include "hmatrix_tree_data.hpp" // for HMat...
#include "htool/hmatrix/interfaces/virtual_lrmat_generator.hpp" // for Virt...
#include "htool/matrix/matrix.hpp" // for Matrix
#include "htool/misc/misc.hpp" // for unde...
#include "lrmat/lrmat.hpp" // for LowR...
#include <algorithm> // for min
#include <memory> // for make...
#include <queue> // for queue
#include <stack> // for stack
#include <string> // for basi...
#include <utility> // for pair
#include <vector> // for vector
namespace htool {
template <typename CoefficientPrecision>
class VirtualGenerator;
}
namespace htool {
template <typename CoordinatePrecision>
class VirtualAdmissibilityCondition;
}

namespace htool {

Expand Down
26 changes: 15 additions & 11 deletions include/htool/hmatrix/hmatrix_distributed_output.hpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#ifndef HTOOL_HMATRIX_DISTRIBUTED_OUTPUT_HPP
#define HTOOL_HMATRIX_DISTRIBUTED_OUTPUT_HPP

#include "../wrappers/wrapper_mpi.hpp"
#include "hmatrix_output.hpp"
#include <array>
#include <iostream>
#include <mpi.h>
#include "../misc/misc.hpp" // for underlying_type
#include "../wrappers/wrapper_mpi.hpp" // for my_MPI_SIZE_T
#include "hmatrix_output.hpp" // for get_leaves
#include "htool/hmatrix/hmatrix.hpp" // for HMatrix
#include "htool/hmatrix/hmatrix_tree_data.hpp" // for HMatrixTreeData
#include <algorithm> // for max, min, find_if, max_element
#include <array> // for array
#include <cctype> // for isdigit
#include <cstddef> // for size_t
#include <iomanip> // for operator<<, setfill, setw
#include <iostream> // for basic_ostream, basic_ios, bas...
#include <map> // for map
#include <mpi.h> // for MPI_Reduce, MPI_DOUBLE, MPI_I...
#include <string> // for basic_string, to_string, oper...
#include <vector> // for vector

#if defined(_OPENMP)
# include <omp.h>
#endif

namespace htool {

template <typename CoefficientPrecision, typename CoordinatePrecision>
class HMatrix;

template <typename CoefficientPrecision, typename CoordinatePrecision>
struct HMatrixTreeData;

bool is_positive_integer(const std::string &s) {
return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end();
}
Expand Down
27 changes: 13 additions & 14 deletions include/htool/hmatrix/hmatrix_output.hpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#ifndef HTOOL_HMATRIX_OUTPUT_HPP
#define HTOOL_HMATRIX_OUTPUT_HPP

#include <algorithm>
#include <array>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>
#include "../basic_types/tree.hpp" // for preorder_tree_traversal
#include "../misc/misc.hpp" // for underlying_type
#include "hmatrix.hpp" // for HMatrix
#include "hmatrix_tree_data.hpp" // for HMatrixTreeData
#include <algorithm> // for max, min, max_element
#include <array> // for array
#include <cstddef> // for size_t
#include <fstream> // for basic_ostream, operator<<, cha...
#include <iomanip> // for operator<<, setfill, setw
#include <iterator> // for distance
#include <map> // for map
#include <string> // for basic_string, to_string, opera...
#include <vector> // for vector, allocator
#if defined(_OPENMP)
# include <omp.h>
#endif
#include "../misc/misc.hpp"

namespace htool {

template <typename CoefficientPrecision, typename CoordinatePrecision>
class HMatrix;

template <typename CoefficientPrecision, typename CoordinatePrecision>
struct HMatrixTreeData;

template <typename OutputValue>
struct DisplayBlock {
int target_offset;
Expand Down
Loading

0 comments on commit 8096009

Please sign in to comment.