@staticmethod 
    def distanceMatrix(U, V):
        if U.shape[1] != V.shape[1]: 
            raise ValueError("Arrays must have the same number of columns")
        
        normU = numpy.sum(U**2, 1)
        normV = numpy.sum(V**2, 1)
                
        D = numpy.outer(normU, numpy.ones(V.shape[0])) - 2*U.dot(V.T) + numpy.outer(numpy.ones(U.shape[0]), normV) 
        #Fix for slightly negative numbers 
        D[D<0] = 0
        
        try: 
            D **= 0.5
        except FloatingPointError: 
            numpy.set_printoptions(suppress=True, linewidth=200, threshold=2000)
            print(D.shape)
            print(D)
            raise 
        
        return D
Compute a distance matrix between n x d matrix U and m x d matrix V, such 
dataset/ETHPy150Open charanpald/APGL/apgl/util/Util.py/Util.distanceMatrix