pytmpinv 1.0.1__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pytmpinv might be problematic. Click here for more details.
- {pytmpinv-1.0.1/pytmpinv.egg-info → pytmpinv-1.0.2}/PKG-INFO +1 -1
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/pyproject.toml +1 -1
- {pytmpinv-1.0.1 → pytmpinv-1.0.2/pytmpinv.egg-info}/PKG-INFO +1 -1
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/tmpinv/__init__.py +1 -1
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/tmpinv/tmpinv.py +5 -5
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/LICENSE +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/README.md +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/pytmpinv.egg-info/SOURCES.txt +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/pytmpinv.egg-info/dependency_links.txt +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/pytmpinv.egg-info/requires.txt +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/pytmpinv.egg-info/top_level.txt +0 -0
- {pytmpinv-1.0.1 → pytmpinv-1.0.2}/setup.cfg +0 -0
|
@@ -148,7 +148,7 @@ def TMPinvSolve(
|
|
|
148
148
|
S = np.asarray(S, dtype=np.float64)
|
|
149
149
|
if (not np.all((S == -1) | (S == 0) | (S == 1)) or
|
|
150
150
|
np.abs(S).sum(axis=0).max() > 1 or
|
|
151
|
-
np.abs(S).sum(axis=
|
|
151
|
+
np.abs(S).sum(axis=1).max() > 1):
|
|
152
152
|
raise TMPinvInputError("S must be a zero-padded subset of ±I.")
|
|
153
153
|
if M is not None:
|
|
154
154
|
M = np.asarray(M, dtype=np.float64)
|
|
@@ -287,20 +287,20 @@ def tmpinv(
|
|
|
287
287
|
"allowed in tabular matrix programs.")
|
|
288
288
|
|
|
289
289
|
# (result) Perform bound-constrained iterative refinement
|
|
290
|
+
kw = {k: v for k, v in kwargs.items() if k not in {"M", "b_val"}}
|
|
290
291
|
for _ in range(iteration_limit):
|
|
291
292
|
M_idx, b_val = [], []
|
|
292
293
|
x = result.x.reshape(-1, 1)
|
|
293
294
|
for i, (v, (l, h)) in enumerate(zip(x, bounds)):
|
|
295
|
+
v = float(v.item())
|
|
294
296
|
if ((l is not None and v < l - tolerance) or \
|
|
295
297
|
(h is not None and v > h + tolerance)):
|
|
296
298
|
continue # skip out-of-bounds
|
|
297
299
|
M_idx.append(i)
|
|
298
|
-
b_val.append(
|
|
300
|
+
b_val.append(v)
|
|
299
301
|
if len(M_idx) < n_cells:
|
|
300
302
|
M = np.eye(n_cells, dtype=np.float64)[M_idx]
|
|
301
|
-
result = TMPinvSolve(M=M, b_val=b_val,
|
|
302
|
-
*args, **{k: v for k, v in kwargs.items()
|
|
303
|
-
if k not in {"M", "b_val"}})
|
|
303
|
+
result = TMPinvSolve(M=M, b_val=b_val, *args, **kw)
|
|
304
304
|
else:
|
|
305
305
|
break
|
|
306
306
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|