Page MenuHomec4science

cluster_grow.hh
No OneTemporary

File Metadata

Created
Tue, May 21, 04:42

cluster_grow.hh

#ifndef __CLUSTER_GROW_HH__
#define __CLUSTER_GROW_HH__
/* -------------------------------------------------------------------------- */
#include "contact_area.hh"
/* -------------------------------------------------------------------------- */
#include <queue>
/* -------------------------------------------------------------------------- */
class ClusterGrow {
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public:
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
ClusterGrow(Map2d<int> & area,
int initial_state,
int to_check_state = -1,
int contact_state = 1,
int no_contact_state = 0);
virtual ~ClusterGrow();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! start grow of a cluster from a given point
template <bool periodic>
void grow(UInt i, UInt j);
private:
void addIndicesToExplore(std::vector<std::pair<UInt,UInt> > & indices_to_add);
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
UInt getNbClusters(){
UInt tmp = current_state - 2;
return tmp;
};
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
int current_state;
const int to_check_state ;
const int contact_state ;
const int no_contact_state;
Map2d<int> & area;
std::queue<std::pair<UInt,UInt> > index_to_explore;
};
/* -------------------------------------------------------------------------- */
#endif /* __CLUSTER_GROW_HH__ */

Event Timeline