Skip to content

Commit

Permalink
dmat_p can be done in place
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed Jan 30, 2019
1 parent c5aa9d0 commit 8e156b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kmeans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ function _kmeans!(X::AbstractMatrix{T},
else
# if only a small subset is affected, only compute for that subset
affected_inds = findall(to_update)
dmat_p = pairwise(distance, view(centers, :, affected_inds), X)
dmat[affected_inds, :] .= dmat_p
pairwise!(view(dmat, affected_inds, :), distance,
view(centers, :, affected_inds), X)
end

# update assignments
Expand Down

0 comments on commit 8e156b5

Please sign in to comment.