Skip to content
Snippets Groups Projects
Commit de3ba37a authored by Niklaus Johner's avatar Niklaus Johner
Browse files

Speed up for the AvereageDistanceMatrixFromTraj function

parent 58f6e703
No related branches found
No related tags found
No related merge requests found
......@@ -206,6 +206,7 @@ def AverageDistanceMatrixFromTraj(t,sele,first=0,last=-1):
M=npy.zeros([n_atoms,n_atoms])
for i,a1 in enumerate(sele.atoms):
for j,a2 in enumerate(sele.atoms):
if j>i:continue
d=ost.mol.alg.AnalyzeDistanceBetwAtoms(t,a1.GetHandle(),a2.GetHandle())[first:last]
M[i,j]=npy.mean(d)
M[j,i]=npy.mean(d)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment