Author: tlinnet Date: Wed Jun 11 10:08:08 2014 New Revision: 23821 URL: http://svn.gna.org/viewcvs/relax?rev=23821&view=rev Log: Reordered how the structures dw init structures are created. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=23821&r1=23820&r2=23821&view=diff ============================================================================== --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 11 10:08:08 2014 @@ -440,10 +440,10 @@ self.dw_struct = deepcopy(zeros_a) # Temporary storage to avoid memory allocations and garbage collection. - self.dw_temp = zeros([self.NS] + self.numpy_array_shape, float64) + self.dw_temp = deepcopy(zeros_a) # The structure for multiplication with dw to piecewise build up the full dw structure. - self.dw_mask = deepcopy(self.dw_temp) + self.dw_mask = zeros(tuple([self.NS] + self.numpy_array_shape), float64) # Loop over the experiment types. for ei in range(self.NE): @@ -561,10 +561,10 @@ # Loop over the dw elements (one per spin). for si in range(self.NS): # First multiply the spin specific dw with the spin specific frequency mask, using temporary storage. - multiply(dw[si], self.dw_mask[si], self.dw_temp[si]) + multiply(dw[si], self.dw_mask[si], self.dw_temp) # Then add to the total, using temporary storage. - add(self.dw_struct, self.dw_temp[si], self.dw_struct) + add(self.dw_struct, self.dw_temp, self.dw_struct) # Reshape dw to per experiment and nr spins. dw_axis = asarray(dw).reshape(self.NE, self.NS)