replaced @ operator by npy.dot
@@ -3615,14 +3615,15 @@ def s2t(s):
# S_II,I^-1
sinv = npy.linalg.inv(s[:, yh:y, 0:xh])
# np.linalg.inv test for singularity (matrix not invertible)
+ for k in range(len(s)):
# T_I,I = S_I,II - S_I,I . S_II,I^-1 . S_II,II
- t[:, 0:yh, 0:xh] = s[:, 0:yh, xh:x] - s[:, 0:yh, 0:xh] @ sinv @ s[:, yh:y, xh:x]
+ t[k, 0:yh, 0:xh] = s[k, 0:yh, xh:x] - s[k, 0:yh, 0:xh].dot(sinv[k].dot(s[k, yh:y, xh:x]))
# T_I,II = S_I,I . S_II,I^-1
- t[:, 0:yh, xh:x] = s[:, 0:yh, 0:xh] @ sinv
+ t[k, 0:yh, xh:x] = s[k, 0:yh, 0:xh].dot(sinv[k])
# T_II,I = -S_II,I^-1 . S_II,II
- t[:, yh:y, 0:xh] = -sinv @ s[:, yh:y, xh:x]
+ t[k, yh:y, 0:xh] = -sinv[k].dot(s[k, yh:y, xh:x])
# T_II,II = S_II,I^-1
- t[:, yh:y, xh:x] = sinv
+ t[k, yh:y, xh:x] = sinv[k]
return t
@@ -4089,14 +4090,15 @@ def t2s(t):
# T_II,II^-1
tinv = npy.linalg.inv(t[:, yh:y, xh:x])
# np.linalg.inv test for singularity (matrix not invertible)
+ for k in range(len(s)):
# S_I,I = T_I,II . T_II,II^-1
- s[:, 0:yh, 0:xh] = t[:, 0:yh, xh:x] @ tinv
+ s[k, 0:yh, 0:xh] = t[k, 0:yh, xh:x].dot(tinv[k])
# S_I,II = T_I,I - T_I,I,II . T_II,II^-1 . T_II,I
- s[:, 0:yh, xh:x] = t[:, 0:yh, 0:xh]-t[:, 0:yh, xh:x] @ tinv @ t[:, yh:y, 0:xh]
+ s[k, 0:yh, xh:x] = t[k, 0:yh, 0:xh]-t[k, 0:yh, xh:x].dot(tinv[k].dot(t[k, yh:y, 0:xh]))
# S_II,I = T_II,II^-1
- s[:, yh:y, 0:xh] = tinv
+ s[k, yh:y, 0:xh] = tinv[k]
# S_II,II = -T_II,II^-1 . T_II,I
- s[:, yh:y, xh:x] = -tinv @ t[:, yh:y, 0:xh]
+ s[k, yh:y, xh:x] = -tinv[k].dot(t[k, yh:y, 0:xh])
return s
