Mantid
|
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< ImplClusterRegister > | m_Impl |
Pointer to implementation. More... | |
ClusterRegister : A fly-weight ICluster regeister.
Handles the logic of merging clusters.
Definition at line 25 of file ClusterRegister.h.
using Mantid::Crystal::ClusterRegister::MapCluster = std::map<size_t, std::shared_ptr<ICluster> > |
Cluster map.
Definition at line 28 of file ClusterRegister.h.
Mantid::Crystal::ClusterRegister::ClusterRegister | ( | ) |
Constructor.
Definition at line 122 of file ClusterRegister.cpp.
|
virtualdefault |
Destructor.
void Mantid::Crystal::ClusterRegister::add | ( | const size_t & | label, |
const std::shared_ptr< ICluster > & | cluster | ||
) |
Add clusters.
Add/register a cluster.
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().
ClusterRegister::MapCluster Mantid::Crystal::ClusterRegister::clusters | ( | ) | const |
Get all combined clusters.
Get the clusters.
Definition at line 164 of file ClusterRegister.cpp.
References m_Impl.
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.
elements |
Definition at line 180 of file ClusterRegister.cpp.
References m_Impl.
Referenced by Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree().
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.
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().
|
private |
Pointer to implementation.
Definition at line 50 of file ClusterRegister.h.
Referenced by add(), clusters(), and merge().