Skip to content

Commit

Permalink
davies_bouldin: use inbounds
Browse files Browse the repository at this point in the history
  • Loading branch information
alyst authored Oct 30, 2023
1 parent f681112 commit d00acba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clustering_quality.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function _cluquality_davies_bouldin(
for (clu, samples) in zip(clu_idx, clu_samples)]
center_dists = pairwise(metric, centers, dims=2)

return mean(maximum((clu_diams[j₁] + clu_diams[j₂]) / center_dists[j₁, j₂]
return mean(maximum(@inbounds (clu_diams[j₁] + clu_diams[j₂]) / center_dists[j₁, j₂]
for j₂ in clu_idx if j₂ j₁)
for j₁ in clu_idx)
end
Expand Down

0 comments on commit d00acba

Please sign in to comment.