charnley / rmsd

Calculate Root-mean-square deviation (RMSD) of two molecules, using rotation, in xyz or pdb format
BSD 2-Clause "Simplified" License
495 stars 114 forks source link

Modify W instead of V #59

Closed Koushikphy closed 5 years ago

Koushikphy commented 5 years ago

https://github.com/charnley/rmsd/blob/cd8af499fb63529a1b5b1f880fdb2dab2731544a/rmsd/calculate_rmsd.py#L155-L157 Why do we have to modify the value of S, it's not needed anywhere in the function? Also instead of modifying

V[:, -1] = -V[:, -1] 

can't we just do this

W[-1]  = -W[-1]

Both properly changes the sign of rotation matrix, but in later case we just have to traverse over the outer index. This can result in a (very) slight gain in computation time for larger number of particles

charnley commented 5 years ago

@Koushikphy , looks correct. It definitely wasn't the computational bottleneck, but it will be corrected in the next version. Thanks for spotting it.