# Path: clusterpy/core/toolboxes/cluster/componentsAlg/distanceFunctions.py
# def square_double(x):
# def distanceA2AEuclideanSquared(x, std=[], w=[]):
# def getHammingDistance(X, Y):
#     def recode(X):
# def distanceA2AHausdorff(x, y):
#         XP = X + []
#     XP = recode(X)
#     YP = recode(Y)


from clusterpy.core.toolboxes.cluster.componentsAlg.distanceFunctions import distMethods
import numpy as np
        self.neighs = neighs
        if variance == "false":
            self.data = data
        else:
            n = (np.sqrt(9 + 8 * (len(data) - 1)) - 3) / 2
            self.var = np.matrix(np.identity(n))
            index = n + 1
            for i in range(int(n)):
                for j in range(i + 1):
                    self.var[i, j] = data[int(index)]
                    self.var[j, i] = data[int(index)]
                    index += 1
            self.data = data[0: int(n + 1)]

    def returnDistance2Area(self, otherArea, distanceType="EuclideanSquared", indexData=[]):
        """
        Return the distance to `otherArea`
        """
        y0 = []
        y1 = []

        if indexData:
            for index in indexData:
                y0 += [self.data[index]]
                y1 += [otherArea.data[index]]
        else:
            y0 = self.data
            y1 = otherArea.data

        data = [y0] + [y1]

# Path: clusterpy/core/toolboxes/cluster/componentsAlg/distanceFunctions.py
# def square_double(x):
# def distanceA2AEuclideanSquared(x, std=[], w=[]):
# def getHammingDistance(X, Y):
#     def recode(X):
# def distanceA2AHausdorff(x, y):
#         XP = X + []
#     XP = recode(X)
#     YP = recode(Y)


# Path: clusterpy/core/toolboxes/cluster/componentsAlg/areacl.py
from clusterpy.core.toolboxes.cluster.componentsAlg.distanceFunctions import distMethods
import numpy as np

        self.neighs = neighs
        if variance == "false":
            self.data = data
        else:
            n = (np.sqrt(9 + 8 * (len(data) - 1)) - 3) / 2
            self.var = np.matrix(np.identity(n))
            index = n + 1
            for i in range(int(n)):
                for j in range(i + 1):
                    self.var[i, j] = data[int(index)]
                    self.var[j, i] = data[int(index)]
                    index += 1
            self.data = data[0: int(n + 1)]

    def returnDistance2Area(self, otherArea, distanceType="EuclideanSquared", indexData=[]):
        """
        Return the distance to `otherArea`
        """
        y0 = []
        y1 = []

        if indexData:
            for index in indexData:
                y0 += [self.data[index]]
                y1 += [otherArea.data[index]]
        else:
            y0 = self.data
            y1 = otherArea.data

        data = [y0] + [y1]

        areaDistance = distMethods[distanceType](data)