From e4c30705ff7bba2ebaa184a72ac57b37e0fc3e2f Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 16 Feb 2016 09:47:07 -0800 Subject: [PATCH] Clean up whitespace in optimization. --- SimPEG/Optimization.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SimPEG/Optimization.py b/SimPEG/Optimization.py index 20a74d0d..9a37b68b 100644 --- a/SimPEG/Optimization.py +++ b/SimPEG/Optimization.py @@ -989,19 +989,20 @@ class ProjectedGNCG(BFGS, Minimize, Remember): if np.logical_or(norm(resid)/normResid0 <= self.tolCG, cgiter == self.maxIterCG): cgFlag = 1 # End CG Iterations - + # Take a gradient step on the active cells if exist if temp != self.xc.size: - + rhs_a = (Active) * -self.g - + dm_i = max( abs( delx ) ) - dm_a = max( abs(rhs_a) ) - + dm_a = max( abs(rhs_a) ) + delx = delx + rhs_a * dm_i / dm_a /10. - + # Only keep gradients going in the right direction on the active set indx = ((self.xc<=self.lower) & (delx < 0)) | ((self.xc>=self.upper) & (delx > 0)) delx[indx] = 0. - return delx \ No newline at end of file + return delx +