All Classes Namespaces Files Functions Variables Typedefs Macros
cliz::Sorter Class Reference

#include <clizSorter.h>

Public Member Functions

 Sorter (SorterHandle iHandle, std::vector< Save * > &iInputSaveVec, std::vector< Save * > &iOutputSaveVec, std::vector< IndicesStruct > iIndicesOut)
 
void calcDist (float &oDist, unsigned int cluster1, unsigned int cluster2)
 
int fusionPossible (unsigned int idMaster, unsigned int idSlave, float diffCrit)
 
void feedSpikeFeatures (float *iFeatures, uint64_t *iTimestamps, int iNspk)
 
void clusteringLoop (unsigned int newClusters)
 
void fuseCluster (unsigned int idMaster, unsigned int idSlave)
 
void killCluster (unsigned int iClusterIndex)
 
void killTheList ()
 
void getClusterCount (int &oClusterCount)
 
void threadFunc ()
 
 ~Sorter ()
 

Detailed Description

Modules Except for the Accumulator and the Communicator, all Modules share the same structure. For initialization, each Module needs a parameter handle, an std::vector of Saves for their input, an std::vector of Saves for their output and an std::vector of IndicesStructs to know which output Saves require which output. During initialization a worker thread is spawned that tries to receive input from all input Saves. Once one ChunkPtrStruct from each input Save was obtained, functions are called that perform the respective jobs of the module. For each output Save, based on the respective IndicesStruct, the data obtained from these functions is copied and a ChunkPtrStruct that holds a pointer to that data is pushed in the output Save.Module: Sorter For each new spike, a new cluster is generated holding just 1 spike. For each cluster pair, its euclidean distance (after normalization and weighting) is determined. From the closest to the most distant pair, they are tested for fusion using specific criteria: Distance < thr_min => Fuse (thr_min = fusionCriteriaParams[0]) Distance > thr_max => Don't fuse and don't test more distant pairs (thr_max = fusionCriteriaParams[1]) max(abs(AC-CC)) < thr_accc => Don't fuse (thr_accc = fusionCriteriaParams[2]) As we pick different features, their correlation might be too weak. Thus, to improve the correlation-based criterium, selected features of the greater cluster's representative are first ordered by their value (and features of the smaller cluster's representative are sorted accordingly (so that the order of feature indices is equal for both cluster's representatives). This increases correlation and makes differences appear more clearly. Each time 2 clusters are fused, the sorting loop starts again, thereby only fusing the closest possible pairs Sorting stops when no more clusters can be fused or the number of clusters reached min_clusters

Constructor & Destructor Documentation

cliz::Sorter::Sorter ( SorterHandle  iHandle,
std::vector< Save * > &  iInputSaveVec,
std::vector< Save * > &  iOutputSaveVec,
std::vector< IndicesStruct iIndicesOut 
)

Module: Sorter Constructor

Here is the call graph for this function:

cliz::Sorter::~Sorter ( )
inline

Here is the call graph for this function:

Member Function Documentation

void cliz::Sorter::calcDist ( float &  oDist,
unsigned int  cluster1,
unsigned int  cluster2 
)
inline

Module: Sorter Calculating the distance between two cluster representatives

Parameters
[out]oDistDistance between the representatives of cluster1 and cluster2 (considering only the selected features)
[in]cluster1Array position of cluster1
[in]cluster2Array position of cluster2

Here is the caller graph for this function:

void cliz::Sorter::clusteringLoop ( unsigned int  newClusters)

Module: Sorter Main clustering loop

Parameters
[in]newClustersNumber of new clusters

Here is the call graph for this function:

Here is the caller graph for this function:

void cliz::Sorter::feedSpikeFeatures ( float *  iFeatures,
uint64_t *  iTimestamps,
int  iNspk 
)

Module: Sorter Feeding the Sorter with new spikes

Parameters
[in]iFeaturesfeatures of new spikes(iNspk*numAllFeatures)
[in]iTimestampstimestamps of new spikes
[in]iNspknumber of new spikes

Here is the call graph for this function:

Here is the caller graph for this function:

void cliz::Sorter::fuseCluster ( unsigned int  idMaster,
unsigned int  idSlave 
)

Module: Sorter Fusing two clusters into one. The new cluster will have the ID of the greater cluster

Parameters
[in]idMasterArray position of the greater cluster
[in]idSlaveArray position of the smaller cluster

Here is the call graph for this function:

Here is the caller graph for this function:

int cliz::Sorter::fusionPossible ( unsigned int  idMaster,
unsigned int  idSlave,
float  diffCrit 
)

Module: Sorter Determining if two clusters should be fused

Parameters
[in]diffCritDistance between the representatives of Master and Slave (considering only the selected features)
[in]idMasterArray position of the greater cluster
[in]idSlaveArray position of the smaller cluster
Returns
1 if fusion is possible, ErrorCode otherwise

Here is the call graph for this function:

Here is the caller graph for this function:

void cliz::Sorter::getClusterCount ( int &  oClusterCount)

Module: Sorter Get current number of clusters

Parameters
[out]oClusterCountCurrent number of clusters
void cliz::Sorter::killCluster ( unsigned int  iClusterIndex)

Module: Sorter Adding a cluster to the kill list

Parameters
[in]iClusterIndexArray position of the greater cluster

Here is the caller graph for this function:

void cliz::Sorter::killTheList ( )

Module: Sorter Deleting all clusters on the kill list

Here is the call graph for this function:

Here is the caller graph for this function:

void cliz::Sorter::threadFunc ( )

Module: Sorter Worker thread

Here is the call graph for this function:

Here is the caller graph for this function:


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