libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
crn::IterativeClustering< T, type > Struct Template Reference

A utility class to create clusters iteratively. More...

#include <CRNIterativeClustering.h>

Public Types

enum  Operation { Operation::None, Operation::Create, Operation::Add, Operation::Merge }
 

Public Member Functions

 IterativeClustering ()=default
 
 IterativeClustering (const IterativeClustering &)=default
 
 IterativeClustering (IterativeClustering &&)=default
 
IterativeClusteringoperator= (const IterativeClustering &)=default
 
IterativeClusteringoperator= (IterativeClustering &&)=default
 
const std::vector< std::set< T > > & GetClusters () const
 Gets the current clusters. More...
 
Operation Associate (const T &v1, const T &v2)
 Associates two elements and merges clusters if needed. More...
 
crn::String ToString () const
 Prints the clusters to a string. More...
 

Detailed Description

template<typename T, typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
struct crn::IterativeClustering< T, type >

A utility class to create clusters iteratively.

A utility class to create clusters iteratively

Warning
The template type must define operator<
Author
Yann LEYDIER
Date
Sept 2012
Version
0.1

Definition at line 51 of file CRNIterativeClustering.h.

Member Enumeration Documentation

template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
enum crn::IterativeClustering::Operation
strong
Enumerator
None 
Create 
Add 
Merge 

Definition at line 65 of file CRNIterativeClustering.h.

Constructor & Destructor Documentation

template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
crn::IterativeClustering< T, type >::IterativeClustering ( )
default
template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
crn::IterativeClustering< T, type >::IterativeClustering ( const IterativeClustering< T, type > &  )
default
template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
crn::IterativeClustering< T, type >::IterativeClustering ( IterativeClustering< T, type > &&  )
default

Member Function Documentation

template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
Operation crn::IterativeClustering< T, type >::Associate ( const T &  v1,
const T &  v2 
)
inline

Associates two elements and merges clusters if needed.

Parameters
[in]v1first element
[in]v2second element
Returns
the operator that was done (None: pair already associated, Create: new cluster created, Add: one element added to a cluster, Merge: two clusters were merged)

Definition at line 72 of file CRNIterativeClustering.h.

template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
const std::vector<std::set<T> >& crn::IterativeClustering< T, type >::GetClusters ( ) const
inline

Gets the current clusters.

Returns
a vector of clusters

Definition at line 63 of file CRNIterativeClustering.h.

template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
IterativeClustering& crn::IterativeClustering< T, type >::operator= ( const IterativeClustering< T, type > &  )
default
template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
IterativeClustering& crn::IterativeClustering< T, type >::operator= ( IterativeClustering< T, type > &&  )
default
template<typename T , typename std::enable_if< std::is_copy_assignable< T >::value &&traits::HasLT< T >::value, int >::type = 0>
crn::String crn::IterativeClustering< T, type >::ToString ( ) const
inline

Prints the clusters to a string.

Warning
the elements must be convertible to crn::String
Returns
a string representing the clusters

Definition at line 128 of file CRNIterativeClustering.h.


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