Skip to content

Commit d10ec27

Browse files
committed
replaced builtin function max with numpy maximum
1 parent 252071e commit d10ec27

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Code/MMA.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ def subsolv(m,n,epsimin,low,upp,alfa,beta,p0,q0,P,Q,a0,a,b,c,d):
360360
stmalfa = np.max(stepalfa)
361361
stepbeta = 1.01*dx/(beta-x)
362362
stmbeta = np.max(stepbeta)
363-
stmalbe = max(stmalfa,stmbeta)
364-
stmalbexx = max(stmalbe,stmxx)
365-
stminv = max(stmalbexx,1.0)
363+
stmalbe = np.maximum(stmalfa,stmbeta)
364+
stmalbexx = np.maximum(stmalbe,stmxx)
365+
stminv = np.maximum(stmalbexx,1.0)
366366
steg = 1.0/stminv
367367
#
368368
xold = x.copy()
@@ -415,7 +415,7 @@ def subsolv(m,n,epsimin,low,upp,alfa,beta,p0,q0,P,Q,a0,a,b,c,d):
415415
steg = steg/2
416416
# End: while (resinew>residunorm) and (itto<50)
417417
residunorm = resinew.copy()
418-
residumax = max(abs(residu))
418+
residumax = np.max(abs(residu))
419419
steg = 2*steg
420420
# End: while (residumax>0.9*epsi) and (ittt<200)
421421
epsi = 0.1*epsi

0 commit comments

Comments
 (0)