STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::stmath::ClusterManager< Tdata, Tcalc > Class Template Reference

An object to track the clusters into which a set of data points can be sorted. More...

#include <cluster_manager.h>

Public Member Functions

 ClusterManager (size_t data_point_count_in=0, int cluster_count_in=1, int attempt_count_in=0)
 The constructor accepts a number of data points and a number of clusters, as well as the number of seeding attempts, if available.
 
size_t getDataPointCount () const
 Get the number of data points.
 
int getClusterCount () const
 Get the number of clusters.
 
int getAttemptCount () const
 Get the number of attempts made to cluster the data resulting in the reported arrangement.
 
int getClusterHome (size_t point_index) const
 Get the cluster to which a specific data point belongs.
 
size_t getClusterSize (int cluster_index) const
 Get the size of a cluster.
 
size_t getClusterPrime (int cluster_index) const
 Get the cluster member nearest the cluster centroid.
 
std::vector< size_t > getClusterMembers (int cluster_index) const
 Get all members of a cluster.
 
const Tdata & getClusterCentroid (int cluster_index) const
 Get the centroid for a particular cluster.
 
const std::vector< Tdata > & getClusterCentroids () const
 Get a const references to the vector of centroids for all clusters.
 
void resize (size_t data_point_count_in, int cluster_count_in)
 Set the number of clusters and data points.
 
void setAttemptCount (int attempt_count_in)
 Set the number of attempts.
 
void setCentroid (int cluster_index, const Tdata value)
 Set the value of one cluster's centroid.
 
 ClusterManager (const ClusterManager &original)
 The copy and move constructors, as well as copy and move assignment operators, must be explicitly instantiated in order to repair POINTER-kind Hybrid objects among the member variables.
 
 ClusterManager (ClusterManager &&original)
 
ClusterManageroperator= (const ClusterManager &original)
 
ClusterManageroperator= (ClusterManager &&original)
 
const ClusterManagerKit< Tcalc > data (HybridTargetLevel tier=HybridTargetLevel::HOST) const
 Get the abstract.
 
ClusterManagerKit< Tcalc > data (HybridTargetLevel tier=HybridTargetLevel::HOST)
 

Detailed Description

template<typename Tdata, typename Tcalc>
class stormm::stmath::ClusterManager< Tdata, Tcalc >

An object to track the clusters into which a set of data points can be sorted.

Constructor & Destructor Documentation

◆ ClusterManager()

template<typename Tdata, typename Tcalc>
stormm::stmath::ClusterManager< Tdata, Tcalc >::ClusterManager ( const ClusterManager< Tdata, Tcalc > & original)

The copy and move constructors, as well as copy and move assignment operators, must be explicitly instantiated in order to repair POINTER-kind Hybrid objects among the member variables.

Parameters
originalThe object to copy or move
otherA pre-existing object to place on the right-hand side of the assignment statement

Member Function Documentation

◆ data()

template<typename Tdata, typename Tcalc>
const ClusterManagerKit< Tcalc > stormm::stmath::ClusterManager< Tdata, Tcalc >::data ( HybridTargetLevel tier = HybridTargetLevel::HOST) const

Get the abstract.

Overloaded:

  • Get a read-only abstract from a const object.
  • Get a non-const, writeable abstract from a non-const object.
Parameters
tierSet points to data on the GPU device or CPU host

◆ getClusterCentroid()

template<typename Tdata, typename Tcalc>
const Tdata & stormm::stmath::ClusterManager< Tdata, Tcalc >::getClusterCentroid ( int cluster_index) const

Get the centroid for a particular cluster.

Parameters
cluster_indexIndex of the cluster of interest

◆ getClusterHome()

template<typename Tdata, typename Tcalc>
int stormm::stmath::ClusterManager< Tdata, Tcalc >::getClusterHome ( size_t point_index) const

Get the cluster to which a specific data point belongs.

Parameters
point_indexIndex of the data point of interest

◆ getClusterMembers()

template<typename Tdata, typename Tcalc>
std::vector< size_t > stormm::stmath::ClusterManager< Tdata, Tcalc >::getClusterMembers ( int cluster_index) const

Get all members of a cluster.

Parameters
cluster_indexIndex of the cluster of interest

◆ getClusterPrime()

template<typename Tdata, typename Tcalc>
size_t stormm::stmath::ClusterManager< Tdata, Tcalc >::getClusterPrime ( int cluster_index) const

Get the cluster member nearest the cluster centroid.

Parameters
cluster_indexIndex of the cluster of interest

◆ getClusterSize()

template<typename Tdata, typename Tcalc>
size_t stormm::stmath::ClusterManager< Tdata, Tcalc >::getClusterSize ( int cluster_index) const

Get the size of a cluster.

Parameters
cluster_indexIndex of the cluster of interest

◆ resize()

template<typename Tdata, typename Tcalc>
void stormm::stmath::ClusterManager< Tdata, Tcalc >::resize ( size_t data_point_count_in,
int cluster_count_in )

Set the number of clusters and data points.

Parameters
data_point_count_inThe new number of data points
cluster_count_inThe new number of clusters to partition data points into

◆ setAttemptCount()

template<typename Tdata, typename Tcalc>
void stormm::stmath::ClusterManager< Tdata, Tcalc >::setAttemptCount ( int attempt_count_in)

Set the number of attempts.

Parameters
attempt_count_inThe number of attempted clusterings to log

◆ setCentroid()

template<typename Tdata, typename Tcalc>
void stormm::stmath::ClusterManager< Tdata, Tcalc >::setCentroid ( int cluster_index,
const Tdata value )

Set the value of one cluster's centroid.

Parameters
cluster_indexIndex of the cluster to set
valueValue of the cluster's new centroid

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