Skip to content

Commit 01b2d3a

Browse files
committed
Use tolerance for ShortestPathKernel
1 parent 4a17b25 commit 01b2d3a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/graph_kernels.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,14 @@ function apply_preprocessed(kernel::ShortestPathGraphKernel, pre1, pre2)
169169
len1 = length(ds1)
170170
len2 = length(ds2)
171171

172-
# TODO we are not using tol here at the moment
173172
i2 = 1
174173
@inbounds for i1 in Base.OneTo(length(ds1))
175174
d1 = ds1[i1]
176-
while i2 <= len2 && d1 > ds2[i2]
175+
while i2 <= len2 && d1 > (ds2[i2] + ε)
177176
i2 += 1
178177
end
179178
j2 = i2
180-
while j2 <= len2 && ds2[j2] <= d1
179+
while j2 <= len2 && ds2[j2] <= (d1 + ε)
181180
result += vertex_kernel(g1, us1[i1], g2, us2[j2])
182181
result += vertex_kernel(g1, vs1[i1], g2, vs2[j2])
183182
j2 += 1

0 commit comments

Comments
 (0)