Author: tlinnet Date: Fri Aug 1 18:09:28 2014 New Revision: 24905 URL: http://svn.gna.org/viewcvs/relax?rev=24905&view=rev Log: Extracted the data view of the index indices numpy array in the target_function. Modified: trunk/target_functions/relax_disp.py Modified: trunk/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=24905&r1=24904&r2=24905&view=diff ============================================================================== --- trunk/target_functions/relax_disp.py (original) +++ trunk/target_functions/relax_disp.py Fri Aug 1 18:09:28 2014 @@ -36,7 +36,7 @@ from lib.dispersion.it99 import r2eff_IT99 from lib.dispersion.lm63 import r2eff_LM63 from lib.dispersion.lm63_3site import r2eff_LM63_3site -from lib.dispersion.matrix_exponential import create_index +from lib.dispersion.matrix_exponential import create_index, data_view_via_striding_array_col from lib.dispersion.m61 import r1rho_M61 from lib.dispersion.m61b import r1rho_M61b from lib.dispersion.mp05 import r1rho_MP05 @@ -471,33 +471,38 @@ # When calculated through the strided data matrix, the data needs to be packed back into the higher order dimensional data. # This is done by first making a numpy array which contains index indices to store, to store the result back to the matrix. if float(version.version[:3]) < 1.8 and model in MODEL_LIST_NUMERIC: - # 2x2 matrix of form [NE][NS][NM][NO][ND][5]. + # 2x2 matrix of form [NE][NS][NM][NO][ND]. if model == MODEL_NS_CPMG_2SITE_STAR or model == MODEL_NS_CPMG_2SITE_STAR_FULL: self.index = create_index(NE=self.NE, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) - # 2x2 matrix of form [NS][NM][NO][ND][4]. + # 2x2 matrix of form [NS][NM][NO][ND]. if model == MODEL_NS_MMQ_2SITE: self.index = create_index(NE=None, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) - # 3x3 matrix of form [NS][NM][NO][ND][4]. + # 3x3 matrix of form [NS][NM][NO][ND]. if model == MODEL_NS_MMQ_3SITE or model == MODEL_NS_MMQ_3SITE_LINEAR: self.index = create_index(NE=None, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) - # 6x6 matrix of form [NE][NS][NM][NO][ND][5]. + # 6x6 matrix of form [NE][NS][NM][NO][ND]. elif model == MODEL_NS_R1RHO_2SITE: self.index = create_index(NE=self.NE, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) - # 7x7 matrix of form [NE][NS][NM][NO][ND][5]. + # 7x7 matrix of form [NE][NS][NM][NO][ND]. elif model == MODEL_NS_CPMG_2SITE_3D or model == MODEL_NS_CPMG_2SITE_3D_FULL: self.index = create_index(NE=self.NE, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) - # 9x9 matrix of form [NE][NS][NM][NO][ND][5]. + # 9x9 matrix of form [NE][NS][NM][NO][ND]. elif model == MODEL_NS_R1RHO_3SITE or model == MODEL_NS_R1RHO_3SITE_LINEAR: self.index = create_index(NE=self.NE, NS=self.NS, NM=self.NM, NO=self.NO, ND=self.ND) + + # Get the data view of the index numpy array. + self.index_view = data_view_via_striding_array_col(data_array=self.index) # For numpy versions >= 1.8, store None. else: self.index = None + self.index_view = None + # Set up the model. if model == MODEL_NOREX: