17#include <geos/export.h>
27class GEOS_DLL Clusters {
29 std::vector<std::size_t> m_elemsInCluster;
30 std::vector<std::size_t> m_starts;
31 std::size_t m_numElems;
34 using const_iterator =
decltype(m_elemsInCluster)::const_iterator;
36 explicit Clusters(UnionFind & uf, std::vector<std::size_t> elemsInCluster, std::size_t numElems);
39 std::size_t getNumClusters()
const {
40 return m_starts.size();
44 std::size_t getSize(std::size_t cluster)
const {
45 return static_cast<std::size_t
>(std::distance(begin(cluster), end(cluster)));
49 std::vector<std::size_t> getClusterIds(std::size_t noClusterValue = std::numeric_limits<std::size_t>::max())
const;
52 const_iterator begin(std::size_t cluster)
const {
53 return std::next(m_elemsInCluster.begin(),
static_cast<std::ptrdiff_t
>(m_starts[cluster]));
57 const_iterator end(std::size_t cluster)
const {
58 if (cluster ==
static_cast<std::size_t
>(m_starts.size() - 1)) {
59 return m_elemsInCluster.end();
62 return begin(cluster + 1);
Basic namespace for all GEOS functionalities.
Definition geos.h:39