/**************************************************************************** * Copyright (c) 2017-2023 by the ArborX authors * * All rights reserved. * * * * This file is part of the ArborX library. ArborX is * * distributed under a BSD 3-clause license. For the licensing terms see * * the LICENSE file in the top-level directory. * * * * SPDX-License-Identifier: BSD-3-Clause * ****************************************************************************/ #ifndef ARBORX_HDBSCAN_HPP #define ARBORX_HDBSCAN_HPP #include #include #include namespace ArborX::Experimental { template auto hdbscan(ExecutionSpace const &exec_space, Primitives const &primitives, int core_min_size, DendrogramImplementation dendrogram_impl = DendrogramImplementation::BORUVKA) { Kokkos::Profiling::ScopedRegion guard("ArborX::HDBSCAN"); using namespace ArborX::Details; using MemorySpace = typename Primitives::memory_space; if (dendrogram_impl == DendrogramImplementation::BORUVKA) { // Hybrid Boruvka+dendrogram MinimumSpanningTree mst( exec_space, primitives, core_min_size); return Dendrogram{mst.dendrogram_parents, mst.dendrogram_parent_heights}; } Kokkos::Profiling::pushRegion("ArborX::HDBSCAN::mst"); MinimumSpanningTree mst(exec_space, primitives, core_min_size); Kokkos::Profiling::popRegion(); Kokkos::Profiling::pushRegion("ArborX::HDBSCAN::dendrogram"); Dendrogram dendrogram(exec_space, mst.edges); Kokkos::Profiling::popRegion(); return dendrogram; } } // namespace ArborX::Experimental #endif