class_docstr: !
  @brief The class represents clustering algorithm ROCK.
  
  Example:
  @code
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.cluster.rock import rock
      from pyclustering.samples.definitions import FCPS_SAMPLES
      from pyclustering.utils import read_sample
  
      # Read sample for clustering from file.
      sample = read_sample(FCPS_SAMPLES.SAMPLE_HEPTA)
  
      # Create instance of ROCK algorithm for cluster analysis. Seven clusters should be allocated.
      rock_instance = rock(sample, 1.0, 7)
  
      # Run cluster analysis.
      rock_instance.process()
  
      # Obtain results of clustering.
      clusters = rock_instance.get_clusters()
  
      # Visualize clustering results.
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
     
docstr: !
  @brief Returns number of link between two clusters. 
  @details Link between objects (points) exists only if distance between them less than connectivity radius.
  
  @param[in] cluster1 (list): The first cluster.
  @param[in] cluster2 (list): The second cluster.
  
  @return (uint) Number of links between two clusters.
docstr_tok: ["!","@","brief","Returns","number","of","link","between","two","clusters",".","@","details","Link","between","objects","(","points",")","exists","only","if","distance","between","them","less","than","connectivity","radius",".","@","param","[","in","]","cluster1","(","list",")",":","The","first","cluster",".","@","param","[","in","]","cluster2","(","list",")",":","The","second","cluster",".","@","return","(","uint",")","Number","of","links","between","two","clusters","."]
code: def __calculate_links(self, cluster1, cluster2):
      """!
      @brief Returns number of link between two clusters.
      @details Link between objects (points) exists only if distance between them less than connectivity radius.
  
      @param[in] cluster1 (list): The first cluster.
      @param[in] cluster2 (list): The second cluster.
  
      @return (uint) Number of links between two clusters.
  
      """
  
      number_links = 0
  
      for index1 in cluster1:
          for index2 in cluster2:
              number_links += self.__adjacency_matrix[index1][index2]
  
      return number_links
  
file_path: pyclustering/pyclustering/cluster/rock.py
imports: from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils import euclidean_distance
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.rock_wrapper
label_desc: Use image node_id 6 for calling the rock obj's underlying member method code with example usage: obj.__calculate_links(cluster1, cluster2) and returns: number_links