Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Crystal::CompositeCluster Class Reference

CompositeCluster : Cluster made by by merging other IClusters. More...

#include <CompositeCluster.h>

Inheritance diagram for Mantid::Crystal::CompositeCluster:
Mantid::Crystal::ICluster

Public Member Functions

void add (std::shared_ptr< ICluster > &toOwn)
 Own. More...
 
void addIndex (const size_t &index) override
 Track a linear IMDHistoWorkspace index that belongs to the cluster. More...
 
 CompositeCluster ()=default
 
 CompositeCluster (const CompositeCluster &)=delete
 
bool containsLabel (const size_t &label) const override
 Is a given label part of this cluster. More...
 
size_t getLabel () const override
 Get the cluster label. More...
 
size_t getOriginalLabel () const override
 Original label. More...
 
size_t getRepresentitiveIndex () const override
 Get a representative index of the cluster. More...
 
ICluster::ClusterIntegratedValues integrate (std::shared_ptr< const Mantid::API::IMDHistoWorkspace > ws) const override
 integrate the cluster More...
 
CompositeClusteroperator= (const CompositeCluster &)=delete
 
void setRootCluster (ICluster const *root) override
 Set the root cluster. More...
 
size_t size () const override
 Number of indexes tracked. More...
 
void toUniformMinimum (std::vector< DisjointElement > &disjointSet) override
 Resolve the proper label for this cluster. More...
 
void writeTo (std::shared_ptr< Mantid::API::IMDHistoWorkspace > ws) const override
 Apply labels to the workspace. More...
 
- Public Member Functions inherited from Mantid::Crystal::ICluster
virtual void addIndex (const size_t &index)=0
 Track a linear IMDHistoWorkspace index that belongs to the cluster. More...
 
virtual bool containsLabel (const size_t &label) const =0
 Is the label contained in the cluster. More...
 
virtual size_t getLabel () const =0
 Get the cluster label. More...
 
virtual size_t getOriginalLabel () const =0
 Get the originally set label. More...
 
virtual size_t getRepresentitiveIndex () const =0
 Get a represetiative index of the cluster. More...
 
virtual ClusterIntegratedValues integrate (std::shared_ptr< const Mantid::API::IMDHistoWorkspace > ws) const =0
 integrate the cluster More...
 
virtual void setRootCluster (ICluster const *root)=0
 Set the root cluster. More...
 
virtual size_t size () const =0
 Number of indexes tracked. More...
 
virtual void toUniformMinimum (std::vector< DisjointElement > &disjointSet)=0
 Resolve the proper label for this cluster. More...
 
virtual void writeTo (std::shared_ptr< Mantid::API::IMDHistoWorkspace > ws) const =0
 Apply labels to the workspace. More...
 
virtual ~ICluster ()=default
 Virtual destructor. More...
 

Private Member Functions

void findMinimum () const
 Helper method to find the minimum label. More...
 

Private Attributes

boost::optional< size_t > m_label
 Label used by cluster. More...
 
std::vector< std::shared_ptr< ICluster > > m_ownedClusters
 Attached clusters. More...
 

Additional Inherited Members

- Public Types inherited from Mantid::Crystal::ICluster
using ClusterIntegratedValues = boost::tuple< double, double >
 

Detailed Description

CompositeCluster : Cluster made by by merging other IClusters.

Definition at line 20 of file CompositeCluster.h.

Constructor & Destructor Documentation

◆ CompositeCluster() [1/2]

Mantid::Crystal::CompositeCluster::CompositeCluster ( )
default

◆ CompositeCluster() [2/2]

Mantid::Crystal::CompositeCluster::CompositeCluster ( const CompositeCluster )
delete

Member Function Documentation

◆ add()

void Mantid::Crystal::CompositeCluster::add ( std::shared_ptr< ICluster > &  toOwn)

Own.

Add other IClusters to own.

Parameters
toOwn: Item to own

Definition at line 155 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ addIndex()

void Mantid::Crystal::CompositeCluster::addIndex ( const size_t &  index)
overridevirtual

Track a linear IMDHistoWorkspace index that belongs to the cluster.

Add an index. This method does not apply to composite clusters.

Implements Mantid::Crystal::ICluster.

Definition at line 88 of file CompositeCluster.cpp.

◆ containsLabel()

bool Mantid::Crystal::CompositeCluster::containsLabel ( const size_t &  label) const
overridevirtual

Is a given label part of this cluster.

Does this cluster contain the label of the argument.

Parameters
label: Label id to find
Returns
True only if that label is contained.

Implements Mantid::Crystal::ICluster.

Definition at line 167 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ findMinimum()

void Mantid::Crystal::CompositeCluster::findMinimum ( ) const
private

Helper method to find the minimum label.

Find the minimum label in the composite.

Definition at line 95 of file CompositeCluster.cpp.

References Mantid::Crystal::ICluster::getLabel(), m_label, and m_ownedClusters.

Referenced by getLabel().

◆ getLabel()

size_t Mantid::Crystal::CompositeCluster::getLabel ( ) const
overridevirtual

Get the cluster label.

Get the label.

Returns
Current label.

Implements Mantid::Crystal::ICluster.

Definition at line 62 of file CompositeCluster.cpp.

References findMinimum(), and m_label.

Referenced by getOriginalLabel().

◆ getOriginalLabel()

size_t Mantid::Crystal::CompositeCluster::getOriginalLabel ( ) const
overridevirtual

Original label.

Get the original label.

Doesn't make sense for composites, so wired through to getLabel()

Returns
getLabel()

Implements Mantid::Crystal::ICluster.

Definition at line 76 of file CompositeCluster.cpp.

References getLabel().

◆ getRepresentitiveIndex()

size_t Mantid::Crystal::CompositeCluster::getRepresentitiveIndex ( ) const
overridevirtual

Get a representative index of the cluster.

Get any representative index from this cluster.

Returns
: Representative index.

Implements Mantid::Crystal::ICluster.

Definition at line 137 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ integrate()

ICluster::ClusterIntegratedValues Mantid::Crystal::CompositeCluster::integrate ( std::shared_ptr< const Mantid::API::IMDHistoWorkspace ws) const
overridevirtual

integrate the cluster

Integrate the composite cluster.

Parameters
ws: Workspace to integrate
Returns
Integrated signal and error sq values.

Implements Mantid::Crystal::ICluster.

Definition at line 35 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ operator=()

CompositeCluster & Mantid::Crystal::CompositeCluster::operator= ( const CompositeCluster )
delete

◆ setRootCluster()

void Mantid::Crystal::CompositeCluster::setRootCluster ( ICluster const *  root)
overridevirtual

Set the root cluster.

Parameters
root: Root cluster to use

Implements Mantid::Crystal::ICluster.

Definition at line 145 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ size()

size_t Mantid::Crystal::CompositeCluster::size ( ) const
overridevirtual

Number of indexes tracked.

Get the size of the composite.

This is the total size of all owned clusters.

Returns
total size.

Implements Mantid::Crystal::ICluster.

Definition at line 82 of file CompositeCluster.cpp.

References m_ownedClusters.

◆ toUniformMinimum()

void Mantid::Crystal::CompositeCluster::toUniformMinimum ( std::vector< DisjointElement > &  disjointSet)
overridevirtual

Resolve the proper label for this cluster.

Convert the disjointSet to a uniform minimum value.

Parameters
disjointSet: DisjointSets to adapt.

Implements Mantid::Crystal::ICluster.

Definition at line 113 of file CompositeCluster.cpp.

References Mantid::Crystal::ICluster::getLabel(), m_label, and m_ownedClusters.

◆ writeTo()

void Mantid::Crystal::CompositeCluster::writeTo ( std::shared_ptr< Mantid::API::IMDHistoWorkspace ws) const
overridevirtual

Apply labels to the workspace.

Write to an output histo workspace.

Parameters
ws

Implements Mantid::Crystal::ICluster.

Definition at line 52 of file CompositeCluster.cpp.

References m_ownedClusters.

Member Data Documentation

◆ m_label

boost::optional<size_t> Mantid::Crystal::CompositeCluster::m_label
mutableprivate

Label used by cluster.

Definition at line 65 of file CompositeCluster.h.

Referenced by findMinimum(), getLabel(), and toUniformMinimum().

◆ m_ownedClusters

std::vector<std::shared_ptr<ICluster> > Mantid::Crystal::CompositeCluster::m_ownedClusters
private

The documentation for this class was generated from the following files: