Docs
Loading...
Searching...
No Matches
ClusterInfo Class Referenceabstract

Abstract interface for cluster information management. More...

#include <ClusterInfo.hpp>

Inheritance diagram for ClusterInfo:
BinaryCache ContinuosCache SpatialCache

Public Member Functions

 ClusterInfo ()=default
virtual void set_allocation (int index, int cluster, int old_cluster)=0
 Assigns a point to a cluster.
virtual void recompute (const int K, const Eigen::VectorXi &allocations)=0
 Recomputes all cluster information from current allocations.
virtual void move_cluster_info (int from_cluster, int to_cluster)=0
 Moves cluster information from one cluster to another.
virtual void remove_info (int cluster)=0
 Removes information related to a specific cluster.
virtual ~ClusterInfo ()=default

Detailed Description

Abstract interface for cluster information management.

This class provides an abstract interface for managing cluster-related information, including caching mechanisms that integrate with the Data class. Derived classes implement specific caching strategies for efficient cluster computations.

Constructor & Destructor Documentation

◆ ClusterInfo()

ClusterInfo::ClusterInfo ( )
default

◆ ~ClusterInfo()

virtual ClusterInfo::~ClusterInfo ( )
virtualdefault

Member Function Documentation

◆ move_cluster_info()

virtual void ClusterInfo::move_cluster_info ( int from_cluster,
int to_cluster )
pure virtual

Moves cluster information from one cluster to another.

Parameters
from_clusterIndex of the source cluster
to_clusterIndex of the target cluster

Implemented in BinaryCache, ContinuosCache, and SpatialCache.

◆ recompute()

virtual void ClusterInfo::recompute ( const int K,
const Eigen::VectorXi & allocations )
pure virtual

Recomputes all cluster information from current allocations.

Parameters
KCurrent number of clusters
allocationsVector of current cluster assignments for all points

Implemented in BinaryCache, ContinuosCache, and SpatialCache.

◆ remove_info()

virtual void ClusterInfo::remove_info ( int cluster)
pure virtual

Removes information related to a specific cluster.

Parameters
clusterIndex of the cluster to remove

Implemented in BinaryCache, ContinuosCache, and SpatialCache.

◆ set_allocation()

virtual void ClusterInfo::set_allocation ( int index,
int cluster,
int old_cluster )
pure virtual

Assigns a point to a cluster.

Parameters
indexIndex of the point to reassign
clusterTarget cluster index (K for new cluster, -1 for unallocated)
old_clusterPrevious cluster index of the point
Exceptions
std::out_of_rangeif index or cluster is invalid

Implemented in BinaryCache, ContinuosCache, and SpatialCache.


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