mailr23966 - /branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py


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

Header


Content

Posted by tlinnet on June 15, 2014 - 16:27:
Author: tlinnet
Date: Sun Jun 15 16:27:07 2014
New Revision: 23966

URL: http://svn.gna.org/viewcvs/relax?rev=23966&view=rev
Log:
Implemented the dot method via blas.

This needs a array with one more axis.

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

Modified:
    branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py

Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py?rev=23966&r1=23965&r2=23966&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original)
+++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Sun Jun 15 
16:27:07 2014
@@ -154,7 +154,7 @@
                 r20a_si_mi_di = r20a[0][si][mi][0][di]
 
                 # Initial magnetisation.
-                Mint = M0
+                Mint = M0.reshape(7, 1)
 
                 # This matrix is a propagator that will evolve the 
magnetization with the matrix R for a delay tcp.
                 Rexpo = matrix_exponential(R*tcp_si_mi_di)
@@ -162,7 +162,7 @@
                 # The numpy way. Give dot two matrices that are both 
C_CONTIGUOUS, then the performance is better:
                 # The essential evolution matrix.
                 # This is the first round.
-                #dot(Rexpo.T, r180x.T, evolution_matrix)
+                #dot(Rexpo, r180x, evolution_matrix)
                 #evolution_matrix = dot(evolution_matrix, Rexpo)
                 # The second round.
                 #evolution_matrix = dot(evolution_matrix, evolution_matrix)
@@ -187,10 +187,10 @@
 
                 # Loop over the CPMG elements, propagating the magnetisation.
                 for j in range(power_si_mi_di/2):
-                    Mint = dot(evolution_matrix, Mint)
+                    Mint = blas_dot(alpha=1.0, a=evolution_matrix.T, 
b=Mint.T, trans_a=True, trans_b=True)
 
                 # The next lines calculate the R2eff using a two-point 
approximation, i.e. assuming that the decay is mono-exponential.
-                Mx = Mint[1] / pA
+                Mx = Mint[1][0] / pA
                 if Mx <= 0.0 or isNaN(Mx):
                     back_calc[0][si][mi][0][di] = r20a_si_mi_di
                 else:




Related Messages


Powered by MHonArc, Updated Sun Jun 15 17:00:02 2014