diff --git a/Base/Util/VectorUtil.cpp b/Base/Util/VectorUtil.cpp index 4c46982a9cd0dd9a81466d3240dae289980a59a9..0998f73f394a8aab981d8a196e1d3fac25b3bd0f 100644 --- a/Base/Util/VectorUtil.cpp +++ b/Base/Util/VectorUtil.cpp @@ -13,42 +13,6 @@ // ************************************************************************************************ #include "Base/Util/VectorUtil.h" -#include <cmath> -#include <stdexcept> - -bool VectorUtil::is_equidistant(const std::vector<double>& vec, double tol) -{ - double span = vec.back() - vec.front(); - if (span == 0.) { - for (std::size_t i = 1; i < vec.size() - 1; ++i) - if (vec[i] != vec.front()) - return false; - return true; - } - - double step = span / vec.size(); - for (std::size_t i = 1; i < vec.size() - 1; ++i) - if (fabs(vec[i]) - (vec.front() + i * step) > tol * step) - return false; - return true; -} - -std::vector<double> VectorUtil::make_grid(std::size_t n, double first, double last) -{ - std::vector<double> result; - result.reserve(n); - - if (n == 1) { - if (first != last) - throw std::runtime_error("Cannot make grid of size 1 unless first == last"); - result.push_back(first); - return result; - } - - for (std::size_t i = 0; i < n; ++i) - result.push_back(first + i * (last - first) / (n - 1)); - return result; -} std::vector<double> VectorUtil::real(const std::vector<complex_t>& v) { diff --git a/Base/Util/VectorUtil.h b/Base/Util/VectorUtil.h index 4d40c4e6f01c3a1e8937d1187475f8aeef1d4a3b..e2f51c6c1ece2c1d3a0cbb6270da8f546c8a725c 100644 --- a/Base/Util/VectorUtil.h +++ b/Base/Util/VectorUtil.h @@ -20,11 +20,6 @@ namespace VectorUtil { -//! Returns true if vector is equidistant within tol * bin_width. -bool is_equidistant(const std::vector<double>& vec, double tol); - -std::vector<double> make_grid(std::size_t n, double first, double last); - //! Returns vector of real parts. std::vector<double> real(const std::vector<complex_t>& v);