From f1590a467fd213f62e7a5fdb5925990c59877d9b Mon Sep 17 00:00:00 2001 From: wehrle Date: Fri, 8 May 2020 14:25:37 +0200 Subject: [PATCH] postproc --- DesOptPy/MainDesOpt.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DesOptPy/MainDesOpt.py b/DesOptPy/MainDesOpt.py index f5afb7f..b257c82 100644 --- a/DesOptPy/MainDesOpt.py +++ b/DesOptPy/MainDesOpt.py @@ -794,11 +794,14 @@ def gradient(self, x): gLUActive = gLU[gLUActiveIndex] gLUNablaActive = gLUNabla[gLUActiveIndex, :] gLUActiveType = np.asarray(["Bound"]*np.size(gLUActive)) - if np.size(gc) > 0: gMaxIt = np.zeros([nIt]) - for ii in range(len(gIt)): - gMaxIt[ii] = max(gIt[ii]) + # THIS IS A STUPID FIX!!!! + for ii in range(nIt): + try: + gMaxIt[ii] = max(gIt[ii]) + except: + gMaxIt[ii] = 0 gOpt = gIt[:, -1] gActiveIndex = gOpt > -epsActive gActive = gOpt[gActiveIndex]