We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d2755e commit 0db1ef9Copy full SHA for 0db1ef9
src/ParallelKMeans.jl
@@ -22,12 +22,16 @@ TODO 2: Document function
22
function pl_pairwise!(target, x, y, nth = Threads.nthreads())
23
ncol = size(x, 2)
24
nrow = size(x, 1)
25
+
26
ranges = divider(nrow, nth)
27
waiting_list = Task[]
28
29
for i in 1:length(ranges) - 1
30
push!(waiting_list, @spawn inner_pairwise!(target, x, y, ranges[i]))
31
end
32
33
inner_pairwise!(target, x, y, ranges[end])
34
35
36
wait(waiting_list[i])
37
@@ -41,6 +45,7 @@ TODO 3: Document function
41
45
"""
42
46
function inner_pairwise!(target, x, y, r)
43
47
48
44
49
@inbounds for k in axes(y, 1)
50
for i in r
51
target[i, k] = (x[i, 1] - y[k, 1])^2
@@ -61,6 +66,7 @@ TODO 4: Document function
61
66
62
67
function pairwise!(target, x, y)
63
68
69
64
70
65
71
for i in axes(x, 1)
72
0 commit comments