mailr11055 - /1.3/generic_fns/structure/main.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 29, 2010 - 17:24:
Author: bugman
Date: Mon Mar 29 17:24:46 2010
New Revision: 11055

URL: http://svn.gna.org/viewcvs/relax?rev=11055&view=rev
Log:
The unit bond vectors are now normalised using the numpy.linalg.norm() 
function.


Modified:
    1.3/generic_fns/structure/main.py

Modified: 1.3/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=11055&r1=11054&r2=11055&view=diff
==============================================================================
--- 1.3/generic_fns/structure/main.py (original)
+++ 1.3/generic_fns/structure/main.py Mon Mar 29 17:24:46 2010
@@ -23,6 +23,7 @@
 # Python module imports.
 from math import sqrt
 from numpy import dot, float64, ndarray, zeros
+from numpy.linalg import norm
 from os import F_OK, access
 from re import search
 from string import replace
@@ -489,7 +490,7 @@
             # Unit vector.
             if unit:
                 # Normalisation factor.
-                norm_factor = sqrt(dot(bond_vectors[i], bond_vectors[i]))
+                norm_factor = norm(bond_vectors[i])
 
                 # Test for zero length.
                 if norm_factor == 0.0:




Related Messages


Powered by MHonArc, Updated Thu Apr 01 00:00:04 2010