diff --git a/src/pairdists.jl b/src/pairdists.jl index b09cc0f..8bd1de9 100644 --- a/src/pairdists.jl +++ b/src/pairdists.jl @@ -73,6 +73,20 @@ end localpdistinds(coords::Vector, radius) = localpdistinds(hcat(coords), radius) +""" restricted_localpdistinds(coords, radius, atoms) + +Like `localdists`, but consider only the atoms with index in `atoms` +""" +function restricted_localpdistinds(coords, radius, atoms) + rc = reshape(reshape(coords, 3, :, size(coords, 2))[:, atoms, :], :, size(coords, 2)) + @show size(rc) + pairs = localpdistinds(rc, radius) + map(pairs) do (a, b) + (atoms[a], atoms[b]) + end +end + + """ pdists(coords::AbstractArray, inds::Vector{<:Tuple})