class_docstr: !
  @brief Class represents clustering algorithm CURE with KD-tree optimization.
  @details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
  
  Here is an example how to perform cluster analysis of sample 'Lsun':
  @code
      from pyclustering.cluster import cluster_visualizer;
      from pyclustering.cluster.cure import cure;
      from pyclustering.utils import read_sample;
      from pyclustering.samples.definitions import FCPS_SAMPLES;
  
      # Input data in following format [ [0.1, 0.5], [0.3, 0.1], ... ].
      input_data = read_sample(FCPS_SAMPLES.SAMPLE_LSUN);
  
      # Allocate three clusters.
      cure_instance = cure(input_data, 3);
      cure_instance.process();
      clusters = cure_instance.get_clusters();
  
      # Visualize allocated clusters.
      visualizer = cluster_visualizer();
      visualizer.append_clusters(clusters, input_data);
      visualizer.show();
  @endcode
class_docstr_tok: ["!","@","brief","Class","represents","clustering","algorithm","CURE","with","KD-tree","optimization",".","@","details","CCORE","option","can","be","used","to","use","the","pyclustering","core","-","C\/C++","shared","library","for","processing","that","significantly","increases","performance",".","Here","is","an","example","how","to","perform","cluster","analysis","of","sample","'Lsun","'",":","@","code","from","pyclustering.cluster","import","cluster_visualizer",";","from","pyclustering.cluster.cure","import","cure",";","from","pyclustering.utils","import","read_sample",";","from","pyclustering.samples.definitions","import","FCPS_SAMPLES",";","#","Input","data","in","following","format","[","[","0.1",",","0.5","]",",","[","0.3",",","0.1","]",",","...","]",".","input_data","=","read_sample","(","FCPS_SAMPLES.SAMPLE_LSUN",")",";","#","Allocate","three","clusters",".","cure_instance","=","cure","(","input_data",",","3",")",";","cure_instance.process","(",")",";","clusters","=","cure_instance.get_clusters","(",")",";","#","Visualize","allocated","clusters",".","visualizer","=","cluster_visualizer","(",")",";","visualizer.append_clusters","(","clusters",",","input_data",")",";","visualizer.show","(",")",";","@","endcode"]
docstr: !
  @brief Calculate minimal distance between clusters using representative points.
  
  @param[in] cluster1 (cure_cluster): The first cluster.
  @param[in] cluster2 (cure_cluster): The second cluster.
  
  @return (double) Euclidean distance between two clusters that is defined by minimum distance between representation points of two clusters.
docstr_tok: ["!","@","brief","Calculate","minimal","distance","between","clusters","using","representative","points",".","@","param","[","in","]","cluster1","(","cure_cluster",")",":","The","first","cluster",".","@","param","[","in","]","cluster2","(","cure_cluster",")",":","The","second","cluster",".","@","return","(","double",")","Euclidean","distance","between","two","clusters","that","is","defined","by","minimum","distance","between","representation","points","of","two","clusters","."]
code: def __cluster_distance(self, cluster1, cluster2):
      """!
      @brief Calculate minimal distance between clusters using representative points.
  
      @param[in] cluster1 (cure_cluster): The first cluster.
      @param[in] cluster2 (cure_cluster): The second cluster.
  
      @return (double) Euclidean distance between two clusters that is defined by minimum distance between representation points of two clusters.
  
      """
  
      distance = float("inf")
      for i in range(0, len(cluster1.rep)):
          for k in range(0, len(cluster2.rep)):
              dist = euclidean_distance_square(
                  cluster1.rep[i], cluster2.rep[k]
              )  # Fast mode
              if dist < distance:
                  distance = dist
  
      return distance
  
imports: import numpy
  from pyclustering.cluster.encoder import type_encoding
  from pyclustering.utils import euclidean_distance_square
  from pyclustering.container.kdtree import kdtree
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.cure_wrapper
label_desc: Use image node_id 19 for calling the cure obj's underlying member method code with example usage: obj.__cluster_distance(cluster1, cluster2) and returns: distance