From 0aef601bfd7be88b90cf16a27067ab9783529f1a Mon Sep 17 00:00:00 2001 From: "Maarten L. Hekkelman" Date: Tue, 14 Apr 2026 09:23:39 +0200 Subject: [PATCH] Remove spherical_dots, fix for finding fast_float, I hope --- CMakeLists.txt | 5 +-- include/cif++/point.hpp | 70 ----------------------------------------- 2 files changed, 3 insertions(+), 72 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2ddf93..fd19cc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -367,8 +367,9 @@ else() endif() if(NOT STD_CHARCONV_COMPILING) - target_include_directories(cifpp PRIVATE ${FastFloat_INCLUDE_DIRS}) - target_compile_definitions(cifpp PRIVATE USE_FAST_FLOAT) + get_target_property(FF_INC_DIR FastFloat::fast_float INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(cifpp PRIVATE ${FF_INC_DIR}) + target_compile_definitions(cifpp PRIVATE USE_FAST_FLOAT) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") diff --git a/include/cif++/point.hpp b/include/cif++/point.hpp index 87ecd72..641433a 100644 --- a/include/cif++/point.hpp +++ b/include/cif++/point.hpp @@ -902,74 +902,4 @@ quaternion align_points(const std::vector &a, const std::vector &b /// \brief The RMSd for the points in \a a and \a b double RMSd(const std::vector &a, const std::vector &b); -// -------------------------------------------------------------------- -/** - * @brief Helper class to generate evenly divided points on a sphere - * - * We use a fibonacci sphere to calculate even distribution of the dots - * - * @tparam N The number of points on the sphere is 2 * N + 1 - */ -template -class spherical_dots -{ - public: - /// \brief the number of points - constexpr static int P = 2 * N * 1; - - /// \brief the *weight* of the fibonacci sphere - constexpr static double W = (4 * std::numbers::pi) / P; - - /// \brief the internal storage type - using array_type = typename std::array; - - /// \brief iterator type - using iterator = typename array_type::const_iterator; - - /// \brief singleton instance - static spherical_dots &instance() - { - static spherical_dots sInstance; - return sInstance; - } - - /// \brief The number of points - [[nodiscard]] std::size_t size() const { return P; } - - /// \brief Access a point by index - const point operator[](uint32_t inIx) const { return m_points[inIx]; } - - /// \brief iterator pointing to the first point - [[nodiscard]] iterator begin() const { return m_points.begin(); } - - /// \brief iterator pointing past the last point - [[nodiscard]] iterator end() const { return m_points.end(); } - - /// \brief return the *weight*, - [[nodiscard]] double weight() const { return W; } - - spherical_dots() - { - const double - kGoldenRatio = std::numbers::phi; - - auto p = m_points.begin(); - - for (int32_t i = -N; i <= N; ++i) - { - double lat = std::asin((2.0 * i) / P); - double lon = std::fmod(i, kGoldenRatio) * 2 * std::numbers::pi / kGoldenRatio; - - p->m_x = std::sin(lon) * std::cos(lat); - p->m_y = std::cos(lon) * std::cos(lat); - p->m_z = std::sin(lat); - - ++p; - } - } - - private: - array_type m_points; -}; - } // namespace cif