Ocean
|
This class implements one cluster that holds the mean values of all observations belonging to this cluster and the indices of all observations belonging to this cluster. More...
Public Member Functions | |
Cluster (Cluster &&cluster) noexcept | |
Move constructor for another cluster object. More... | |
const Observation & | mean () const |
Returns the mean observation value of this cluster. More... | |
const DataIndices & | dataIndices () const |
Returns the indices of the observations that belong to this cluster. More... | |
TSquareDistance | sqrDistance (const Observation &observation) const |
Returns the square distance between a given observation and this cluster (the mean observation value of this cluster). More... | |
TSquareDistance | maximalSqrDistance (DataIndex *observationIndex=nullptr) const |
Calculates the maximal square distance between the mean observation value of this cluster and all observations which belong to this cluster. More... | |
TSquareDistance | averageSqrDistance () const |
Calculates the average square distance between the mean observation value of this cluster and all observations which belong to this cluster. More... | |
Cluster & | operator= (Cluster &&cluster) noexcept |
Move operator moving a cluster object to this object. More... | |
bool | operator< (const Cluster &cluster) const |
Returns whether the left cluster has less elements than the right cluster. More... | |
Protected Member Functions | |
Cluster (const ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices > &owner, const Observation &mean) | |
Creates a new cluster object by a given mean value. More... | |
Cluster (const ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices > &owner, const Observation &mean, const DataIndices &dataIndices) | |
Creates a new cluster object by a given mean value and several indices of observations that belong to this cluster. More... | |
Cluster (const ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices > &owner, const Observation &mean, DataIndices &&dataIndices) | |
Creates a new cluster object by a given mean value and several indices of observations that belong to this cluster. More... | |
DataIndices & | dataIndices () |
Returns the data-indices of the observations that belong to this cluster. More... | |
void | updateMean () |
Updates the mean observation value of this cluster by application of the stored indices of all observations that belong to this cluster. More... | |
Protected Attributes | |
const ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices > * | owner_ |
The owner of this cluster. More... | |
Observation | mean_ |
The mean observation value of this cluster. More... | |
DataIndices | dataIndices_ |
The data indices of all observation that belong to this cluster. More... | |
Friends | |
class | ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices > |
class | std::allocator< Cluster > |
This class implements one cluster that holds the mean values of all observations belonging to this cluster and the indices of all observations belonging to this cluster.
|
inlinenoexcept |
Move constructor for another cluster object.
cluster | The cluster object to be moved |
|
inlineprotected |
Creates a new cluster object by a given mean value.
owner | The owner of this cluster object |
mean | The mean observation value that will define this cluster |
|
inlineprotected |
Creates a new cluster object by a given mean value and several indices of observations that belong to this cluster.
owner | The owner of this cluster object |
mean | The mean observation value that will define this cluster |
dataIndices | The data-indices of the observations that belong to this cluster |
|
inlineprotected |
Creates a new cluster object by a given mean value and several indices of observations that belong to this cluster.
owner | The owner of this cluster object |
mean | The mean observation value that will define this cluster |
dataIndices | The data-indices of the observations that belong to this cluster; beware: the indices will be moved to this cluster object |
TSquareDistance Ocean::ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices >::Cluster::averageSqrDistance |
Calculates the average square distance between the mean observation value of this cluster and all observations which belong to this cluster.
|
inlineprotected |
Returns the data-indices of the observations that belong to this cluster.
|
inline |
Returns the indices of the observations that belong to this cluster.
TSquareDistance Ocean::ClusteringKMeans< T, tDimension, TSum, TSquareDistance, tUseIndices >::Cluster::maximalSqrDistance | ( | DataIndex * | observationIndex = nullptr | ) | const |
Calculates the maximal square distance between the mean observation value of this cluster and all observations which belong to this cluster.
observationIndex | Optional resulting index of the observation with maximal distance to the mean observation value, if defined |
|
inline |
Returns the mean observation value of this cluster.
|
inline |
Returns whether the left cluster has less elements than the right cluster.
cluster | The right cluster to compare |
|
inlinenoexcept |
Move operator moving a cluster object to this object.
cluster | The cluster object to be moved |
|
inline |
Returns the square distance between a given observation and this cluster (the mean observation value of this cluster).
observation | The observation for that the distance is returned |
|
protected |
Updates the mean observation value of this cluster by application of the stored indices of all observations that belong to this cluster.
|
friend |
|
friend |
|
protected |
The data indices of all observation that belong to this cluster.
|
protected |
The mean observation value of this cluster.
|
protected |
The owner of this cluster.