Author: bugman Date: Fri Jan 11 11:13:20 2008 New Revision: 4630 URL: http://svn.gna.org/viewcvs/relax?rev=4630&view=rev Log: Bug fix for the generic_fns.align_tensor.svd() function. The size of the matrix now shrinks if not all tensors are used. Modified: branches/N_state_model/generic_fns/align_tensor.py Modified: branches/N_state_model/generic_fns/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/generic_fns/align_tensor.py?rev=4630&r1=4629&r2=4630&view=diff ============================================================================== --- branches/N_state_model/generic_fns/align_tensor.py (original) +++ branches/N_state_model/generic_fns/align_tensor.py Fri Jan 11 11:13:20 2008 @@ -1362,8 +1362,14 @@ if not hasattr(cdp, 'align_tensor') or len(cdp.align_tensor) == 0: raise RelaxNoTensorError, 'alignment' + # Count the number of tensors used in the SVD. + tensor_num = 0 + for tensor in cdp.align_tensor: + if tensors and tensor.name in tensors: + tensor_num = tensor_num + 1 + # Create the matrix to apply SVD on. - matrix = zeros((len(cdp.align_tensor), 5), float64) + matrix = zeros((tensor_num, 5), float64) # Pack the elements. i = 0