mailr24348 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py


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

Header


Content

Posted by tlinnet on June 27, 2014 - 17:09:
Author: tlinnet
Date: Fri Jun 27 17:09:45 2014
New Revision: 24348

URL: http://svn.gna.org/viewcvs/relax?rev=24348&view=rev
Log:
Made the validation check in profiling of marix_power check all values.

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion 
models for Clustered analysis.

Modified:
    
branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py

Modified: 
branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py?rev=24348&r1=24347&r2=24348&view=diff
==============================================================================
--- 
branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
      (original)
+++ 
branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_matrix_power.py
      Fri Jun 27 17:09:45 2014
@@ -36,12 +36,12 @@
 import tempfile
 
 from numpy.lib.stride_tricks import as_strided
-from numpy import arange, array, asarray, int16, sum, zeros
+from numpy import any, arange, array, asarray, int16, sum, zeros
 from numpy.linalg import matrix_power
 
 def main():
     # Nr of iterations.
-    nr_iter = 50
+    nr_iter = 10
 
     # Print statistics.
     verbose = True
@@ -428,19 +428,23 @@
         calc_normal = self.calc_normal(data, power)
 
         # Find the difference to the validated method.
-        diff_normal = calc_normal - self.vali
-
-        if sum(diff_normal) != 0.0:
+        diff_normal_test = calc_normal != self.vali
+
+        if any(diff_normal_test):
+            diff_normal = calc_normal - self.vali
             print("The normal method is different from the validated data")
+            print(diff_normal)
 
         # Calculate by strided way.
         calc_strided = self.calc_strided(data, power)
 
         # Find the difference to the validated method.
-        diff_strided = calc_strided - self.vali
-
-        if sum(diff_strided) != 0.0:
+        diff_strided_test = calc_strided != self.vali
+
+        if any(diff_strided_test):
+            diff_strided = calc_strided - self.vali
             print("The strided method is different from the validated data")
+            print(diff_strided )
 
 
 def single_normal(NS=1, iter=None):




Related Messages


Powered by MHonArc, Updated Fri Jun 27 17:20:02 2014