/** * Get the clusters * @return both merged and unique clusters in a single map. */ ClusterRegister::MapCluster ClusterRegister::clusters() const { MapCluster temp; temp.insert(m_Impl->m_unique.begin(), m_Impl->m_unique.end()); auto mergedClusters = m_Impl->makeCompositeClusters(); for (const auto &merged : mergedClusters) { temp.emplace(merged->getLabel(), merged); } return temp; }
/** * Get the clusters. Also set the elements to the uniform minimum of each * cluster. * @param elements * @return: Map of merged clusters. */ ClusterRegister::MapCluster ClusterRegister::clusters(std::vector<DisjointElement> &elements) const { MapCluster temp; temp.insert(m_Impl->m_unique.begin(), m_Impl->m_unique.end()); auto mergedClusters = m_Impl->makeCompositeClusters(); for (auto &merged : mergedClusters) { merged->toUniformMinimum(elements); temp.emplace(merged->getLabel(), merged); } return temp; }