public function hoshen_kopelman(matrix) result(num_clusters)
Hoshen-Kopelman algorithm for labelling clusters on
a binary matrix.
The function takes in a binary matrix
(zeros and positive numbers), labels the clusters of
positive numbers and returns the total number of clusters
found. The argument matrix is overwritten with the labels.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.