Vendored algorithm port — derived from scikit-learn and scikit-learn-contrib/hdbscan.
=====================================================================================

hdbscan.{hpp,cpp} in this directory are an independent C++ rewrite of the
HDBSCAN* code paths of:

  - scikit-learn 1.9.1, sklearn/cluster/_hdbscan/{hdbscan.py,_linkage.pyx,
    _tree.pyx} (BSD-3-Clause), Copyright (c) 2007-2026 The scikit-learn
    developers. https://github.com/scikit-learn/scikit-learn
  - scikit-learn-contrib/hdbscan 0.8.44, hdbscan/_hdbscan_tree.pyx
    (outlier_scores, get_stability_scores; BSD-3-Clause), Copyright (c) 2015,
    Leland McInnes. https://github.com/scikit-learn-contrib/hdbscan

The control flow and floating-point operation order are reproduced so the
outputs match those references; no Python/Cython source is copied verbatim.
The only intentional difference is a stable sort of equal-weight MST edges,
where scikit-learn's np.argsort order is unspecified.

Original references:
  Campello, R. J. G. B., Moulavi, D., & Sander, J. (2013). Density-based
      clustering based on hierarchical density estimates. PAKDD.
  Campello, R. J. G. B., Moulavi, D., Zimek, A., & Sander, J. (2015).
      Hierarchical density estimates for data clustering, visualization, and
      outlier detection. ACM TKDD 10(1).
  McInnes, L., Healy, J., & Astels, S. (2017). hdbscan: Hierarchical density
      based clustering. JOSS 2(11), 205.

Both upstream projects are distributed under the BSD-3-Clause license:

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products derived from
     this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

The n4m source files in this directory are licensed under CECILL-2.1 (see the
repository-level LICENSE); BSD-3-Clause is permissive and compatible.
