Template Function beluga::clusterizer_detail::assign_clusters

Function Documentation

template<class State, class NeighborsFunction>
static void beluga::clusterizer_detail::assign_clusters(ClusterMap<State> &map, NeighborsFunction &&neighbors_function)

Assign cluster ids to an existing cluster map.

This function implements a clustering algorithm that assigns cluster IDs to cells in a map based on their spatial relationships.

Notice that with this algorithm each cell will go through the priority queue at most twice.

Template Parameters:
  • State – The state type of the cells in the map.

  • NeighborsFunction – A callable object that, given a state, returns a range of neighboring cell hashes.

Parameters:
  • map – A reference to the map where cells are stored.

  • neighbors_function – A function that returns neighboring cell hashes for a given state.