Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::polymorphism::fuzzy_transfer_distance::FuzzyPartition< Element > Class Template Reference

#include <quetzal/polymorphism/fuzzy_transfer_distance/FuzzyPartition.hpp>

Detailed Description

template<typename Element>
class quetzal::polymorphism::fuzzy_transfer_distance::FuzzyPartition< Element >

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.

Warning
In the present implementation, Clusters IDs are not memorized, because it would complicate fuzzy partition operations as merging clusters. So clusters are stored in the order given by their identifiers at construction, but the IDs themselves are not stored.
Template Parameters
ElementsElements 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.
 
FuzzyPartitionmerge_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 &)
 

Constructor & Destructor Documentation

◆ FuzzyPartition()

template<typename Element >
quetzal::polymorphism::fuzzy_transfer_distance::FuzzyPartition< Element >::FuzzyPartition ( std::map< element_type, std::vector< double > > const &  coefficients)
inline

Construct the fuzz partition with given coefficients.

Warning
All vector have to be of same size.
The vectors index gives the cluster index.

Member Function Documentation

◆ fuzzy_transfer_distance()

template<typename Element >
double quetzal::polymorphism::fuzzy_transfer_distance::FuzzyPartition< Element >::fuzzy_transfer_distance ( FuzzyPartition< Element > const &  other) const
inline

Compute the fuzzy transfer distance between two fuzzy partition.

Partitons must have same elements number, but number of clusters can differe.

◆ merge_clusters()

template<typename Element >
FuzzyPartition & quetzal::polymorphism::fuzzy_transfer_distance::FuzzyPartition< Element >::merge_clusters ( RestrictedGrowthString const &  rgs)
inline

Modifies the object, merging clusters (summing lines) according to a restricted growth string object.

size1 = nbr of rows


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