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

ClusterRegister : A fly-weight ICluster regeister. More...

#include <ClusterRegister.h>

Public Types

using MapCluster = std::map< size_t, std::shared_ptr< ICluster > >
 Cluster map. More...
 

Public Member Functions

void add (const size_t &label, const std::shared_ptr< ICluster > &cluster)
 Add clusters. More...
 
 ClusterRegister ()
 Constructor. More...
 
MapCluster clusters () const
 Get all combined clusters. More...
 
MapCluster clusters (std::vector< DisjointElement > &elements) const
 Get all combined clusters. More...
 
void merge (const DisjointElement &a, const DisjointElement &b) const
 Merge clusters on the basis of known pairs of disjoint elements. More...
 
virtual ~ClusterRegister ()
 Destructor. More...
 

Private Attributes

boost::scoped_ptr< ImplClusterRegisterm_Impl
 Pointer to implementation. More...
 

Detailed Description

ClusterRegister : A fly-weight ICluster regeister.

Handles the logic of merging clusters.

Definition at line 25 of file ClusterRegister.h.

Member Typedef Documentation

◆ MapCluster

using Mantid::Crystal::ClusterRegister::MapCluster = std::map<size_t, std::shared_ptr<ICluster> >

Cluster map.

Definition at line 28 of file ClusterRegister.h.

Constructor & Destructor Documentation

◆ ClusterRegister()

Mantid::Crystal::ClusterRegister::ClusterRegister ( )

Constructor.

Definition at line 122 of file ClusterRegister.cpp.

◆ ~ClusterRegister()

Mantid::Crystal::ClusterRegister::~ClusterRegister ( )
virtualdefault

Destructor.

Member Function Documentation

◆ add()

void Mantid::Crystal::ClusterRegister::add ( const size_t &  label,
const std::shared_ptr< ICluster > &  cluster 
)

Add clusters.

Add/register a cluster.

Parameters
label: Label as key
cluster: Cluster with label

Definition at line 133 of file ClusterRegister.cpp.

References m_Impl.

Referenced by Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree().

◆ clusters() [1/2]

ClusterRegister::MapCluster Mantid::Crystal::ClusterRegister::clusters ( ) const

Get all combined clusters.

Get the clusters.

Returns
both merged and unique clusters in a single map.

Definition at line 164 of file ClusterRegister.cpp.

References m_Impl.

◆ clusters() [2/2]

ClusterRegister::MapCluster Mantid::Crystal::ClusterRegister::clusters ( std::vector< DisjointElement > &  elements) const

Get all combined clusters.

Get the clusters.

Also set the elements to the uniform minimum of each cluster.

Parameters
elements
Returns
: Map of merged clusters.

Definition at line 180 of file ClusterRegister.cpp.

References m_Impl.

Referenced by Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree().

◆ merge()

void Mantid::Crystal::ClusterRegister::merge ( const DisjointElement a,
const DisjointElement b 
) const

Merge clusters on the basis of known pairs of disjoint elements.

Use known pairs of disjoint elements to perform cluster merges.

Parameters
a: Disjoint element which is part of pair
b: Disjoint element with is part of pair

Definition at line 143 of file ClusterRegister.cpp.

References Mantid::Crystal::DisjointElement::getId(), Mantid::Crystal::DisjointElement::isEmpty(), and m_Impl.

Referenced by Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree().

Member Data Documentation

◆ m_Impl

boost::scoped_ptr<ImplClusterRegister> Mantid::Crystal::ClusterRegister::m_Impl
private

Pointer to implementation.

Definition at line 50 of file ClusterRegister.h.

Referenced by add(), clusters(), and merge().


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