clustering.py
def calcDistanceMatrix(targets):
    '''compute full pairwise target distance matrix in parallel'''
    n = len(targets)
    pairs = [(r, c) for r in range(n) for c in range(r+1, n)] #upper triangle
    pool = Pool()
    function = partial(cUTDM2, targets)
    distanceTuples = pool.map(function, pairs)
    distanceMatrix = np.zeros((n, n))
    for (a, b, distance) in distanceTuples:
        distanceMatrix[a][b] = distanceMatrix[b][a] = distance
    return distanceMatrix
compute full pairwise target distance matrix in parallel
compute full pairwise target distance matrix in parallel
compute full pairwise target distance matrix in parallel
def calcDistanceMatrix(targets):
    n = len(targets)
    pairs = [(r, c) for r in range(n) for c in range(r+1, n)] 
    pool = Pool()
    function = partial(cUTDM2, targets)
    distanceTuples = pool.map(function, pairs)
    distanceMatrix = np.zeros((n, n))
    for (a, b, distance) in distanceTuples:
        distanceMatrix[a][b] = distanceMatrix[b][a] = distance
    return distanceMatrix
def calcDistanceMatrix ( targets ) : n = len ( targets ) pairs = [ ( r , c ) for r in range ( n ) for c in range ( r + 1 , n ) ] pool = Pool ( ) function = partial ( cUTDM2 , targets ) distanceTuples = pool . map ( function , pairs ) distanceMatrix = np . zeros ( ( n , n ) ) for ( a , b , distance ) in distanceTuples : distanceMatrix [ a ] [ b ] = distanceMatrix [ b ] [ a ] = distance return distanceMatrix
compute full pairwise target distance matrix in parallel
compute full pairwise target distance matrix in parallel
'''compute full pairwise target distance matrix in parallel''' #upper triangle
targets