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 Performs cluster analysis in line with rules of ROCK algorithm.
  
  @return (rock) Returns itself (ROCK instance).
  
  @see get_clusters()
docstr_tok: ["!","@","brief","Performs","cluster","analysis","in","line","with","rules","of","ROCK","algorithm",".","@","return","(","rock",")","Returns","itself","(","ROCK","instance",")",".","@","see","get_clusters","(",")"]
code: def process(self):
      """!
      @brief Performs cluster analysis in line with rules of ROCK algorithm.
  
      @return (rock) Returns itself (ROCK instance).
  
      @see get_clusters()
  
      """
  
      # TODO: (Not related to specification, just idea) First iteration should be investigated. Euclidean distance should be used for clustering between two
      # points and rock algorithm between clusters because we consider non-categorical samples. But it is required more investigations.
  
      if self.__ccore is True:
          self.__clusters = wrapper.rock(
              self.__pointer_data,
              self.__eps,
              self.__number_clusters,
              self.__threshold,
          )
  
      else:
          self.__clusters = [
              [index] for index in range(len(self.__pointer_data))
          ]
  
          while len(self.__clusters) > self.__number_clusters:
              indexes = self.__find_pair_clusters(self.__clusters)
  
              if indexes != [-1, -1]:
                  self.__clusters[indexes[0]] += self.__clusters[
                      indexes[1]
                  ]
                  self.__clusters.pop(
                      indexes[1]
                  )  # remove merged cluster.
              else:
                  break  # totally separated clusters have been allocated
      return self
  
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 2 for calling the rock obj's underlying member method code with example usage: obj.process() and returns: self