![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
#include <quetzal/polymorphism/fuzzy_transfer_distance/FuzzyPartition.hpp>
Clusters are implicitly defined because of cluster merging (what would make unique IDs complicated to use)
Template class usefull for formalizing that elements of a set can simultaneously belong to various clusters.
Fuzzy partition are objects of interest when one wants to represent the fact that an element of a set can belong to several clusters. This can be represented by a matrix M(i,j), with clusters in line and elements in column, where the general term mu(i,j) represent the coefficient of membership of an element to a cluster. Coefficients memberships summed on all clusters are equal to 1.
Elements | Elements identifiers. |
Public Types | |
using | element_type = Element |
using | cluster_type = unsigned int |
Public Member Functions | |
FuzzyPartition (std::map< element_type, std::vector< double > > const &coefficients) | |
Construct the fuzz partition with given coefficients. | |
const std::set< element_type > & | elements () const |
Return the elements of the fuzzy partition. | |
const std::set< cluster_type > & | clusters () const |
Return the clusters indices. | |
size_t | nElements () const |
Returns the number of elements (columns) of the fuzzy partition (matrix) | |
size_t | nClusters () const |
Returns the number of clusters (lines) of the fuzzy partition (matrix) | |
double | fuzzy_transfer_distance (FuzzyPartition const &other) const |
Compute the fuzzy transfer distance between two fuzzy partition. | |
FuzzyPartition & | merge_clusters (RestrictedGrowthString const &rgs) |
Modifies the object, merging clusters (summing lines) according to a restricted growth string object. | |
bool | operator== (FuzzyPartition< element_type > const &other) const |
Comparison operator, returning true if two partitions have equal elements set and membership coefficent, else returns false. | |
Friends | |
std::ostream & | operator<< (std::ostream &, FuzzyPartition< element_type > const &) |
|
inline |
Construct the fuzz partition with given coefficients.
|
inline |
Compute the fuzzy transfer distance between two fuzzy partition.
Partitons must have same elements number, but number of clusters can differe.
|
inline |
Modifies the object, merging clusters (summing lines) according to a restricted growth string object.
size1 = nbr of rows