diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2021-06-07 17:59:27 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2021-06-07 17:59:27 +0200 |
commit | 3a06eff2f6345133270ddc50b625139761c06df6 (patch) | |
tree | 33cdd6348088e3378f2bdcb172fa49cf58d5ea4a /src | |
parent | 0828b90ffabf239dc9811f299427349d6d4f8bf4 (diff) |
Use boost pi and do not declare a gudhi one. cf. PR #480
Diffstat (limited to 'src')
-rw-r--r-- | src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h | 6 | ||||
-rw-r--r-- | src/common/include/gudhi/math.h | 23 |
2 files changed, 3 insertions, 26 deletions
diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h b/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h index fbc1c895..6a896e94 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h @@ -15,8 +15,6 @@ #include <cmath> // for std::cos, std::sin #include <random> // for std::uniform_real_distribution, std::random_device -#include <gudhi/math.h> - #include <Eigen/Dense> #include <Eigen/Sparse> #include <Eigen/SVD> @@ -24,6 +22,8 @@ #include <CGAL/Epick_d.h> #include <CGAL/point_generators_d.h> +#include <boost/math/constants/constants.hpp> // for PI value + namespace Gudhi { namespace coxeter_triangulation { @@ -44,7 +44,7 @@ Eigen::MatrixXd random_orthogonal_matrix(std::size_t d) { if (d == 1) return Eigen::VectorXd::Constant(1, 1.0); if (d == 2) { // 0. < alpha < 2 Pi - std::uniform_real_distribution<double> unif(0., 2 * Gudhi::PI); + std::uniform_real_distribution<double> unif(0., 2 * boost::math::constants::pi<double>()); std::random_device rand_dev; std::mt19937 rand_engine(rand_dev()); double alpha = unif(rand_engine); diff --git a/src/common/include/gudhi/math.h b/src/common/include/gudhi/math.h deleted file mode 100644 index f367bac2..00000000 --- a/src/common/include/gudhi/math.h +++ /dev/null @@ -1,23 +0,0 @@ -/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. - * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. - * Author(s): Vincent Rouvreau - * - * Copyright (C) 2020 Inria - * - * Modification(s): - * - YYYY/MM Author: Description of the modification - */ - -#ifndef MATH_H_ -#define MATH_H_ - -#include <boost/math/constants/constants.hpp> - -namespace Gudhi { - -// In wait of C++20 std::numbers::pi with #include <numbers> -static constexpr double PI = boost::math::constants::pi<double>(); - -} // namespace Gudhi - -#endif // MATH_H_ |