22 explicit Comparitor(
const size_t &label) : m_label(label) {}
23 bool operator()(
const std::shared_ptr<Mantid::Crystal::ICluster> &pCluster)
const {
24 return pCluster->containsLabel(m_label);
39 double errorIntSQ = 0;
43 auto integratedValues = ownedCluster->integrate(ws);
44 sigInt += integratedValues.get<0>();
45 errorIntSQ += integratedValues.get<1>();
56 ownedCluster->writeTo(ws);
67 throw std::runtime_error(
"No child IClusters. CompositeCluster::getLabel() is not supported.");
86 [](
auto sum,
const auto &cluster) { return sum + cluster->size(); });
91 throw std::runtime_error(
"addIndex not implemented on CompositeCluster");
100 size_t minLabel = minCluster->
getLabel();
103 if (temp < minLabel) {
118 size_t minLabel = minCluster->
getLabel();
121 if (temp < minLabel) {
130 ownedCluster->toUniformMinimum(disjointSet);
149 ownedCluster->setRootCluster(root);
158 if (toOwn->size() > 0)
170 Comparitor comparitor(label);
ICluster::ClusterIntegratedValues integrate(std::shared_ptr< const Mantid::API::IMDHistoWorkspace > ws) const override
integrate the cluster
size_t getRepresentitiveIndex() const override
Get a representative index of the cluster.
void setRootCluster(ICluster const *root) override
Set the root cluster.
size_t size() const override
Number of indexes tracked.
void toUniformMinimum(std::vector< DisjointElement > &disjointSet) override
Resolve the proper label for this cluster.
size_t getLabel() const override
Get the cluster label.
void add(std::shared_ptr< ICluster > &toOwn)
Own.
bool containsLabel(const size_t &label) const override
Is a given label part of this cluster.
size_t getOriginalLabel() const override
Original label.
std::optional< size_t > m_label
Label used by cluster.
void addIndex(const size_t &index) override
Track a linear IMDHistoWorkspace index that belongs to the cluster.
void findMinimum() const
Helper method to find the minimum label.
std::vector< std::shared_ptr< ICluster > > m_ownedClusters
Attached clusters.
void writeTo(std::shared_ptr< Mantid::API::IMDHistoWorkspace > ws) const override
Apply labels to the workspace.
ICluster : Abstract cluster.
virtual size_t getLabel() const =0
Get the cluster label.
virtual void setRootCluster(ICluster const *root)=0
Set the root cluster.
boost::tuple< double, double > ClusterIntegratedValues