I think you can just add a loop over the dimensions to do the copy and 
avoid the allocations:

function slow(points::Array{Float64,2})
    n_dim = size(points,1)
    n_points::Int = size(points,2)
    point_2 = zeros(n_dim)
    cum = 0.0
    for i in 1:n_points
        for j in (i+1):n_points
            for k=1:n_dim
                point_2[k] = points[k, j]
            end
            cum += myDist(point_2)
        end
    end
    return cum
end

Reply via email to