Unverified Commit 72019425 authored by René Fritze's avatar René Fritze Committed by GitHub
Browse files

branch off new slycot version (#1689)

I saw that a new slycot version was released last week. It includes my bugfix PR for an incorrectly set `ldwork` variable in the discrete-time case. If we update our requirements to version 0.5.0 or higher, we can remove the workaround bugfix from our bindings.

The new release does not seem to contain drastic changes, although they have switched to a different license and version of SLICOT and there seems to be an issue with NumPy 1.23.0 (but not 1.23.1 and greater).

https://github.com/python-control/Slycot/releases/tag/v0.5.0
parents 7c8bbba8 57ac9e0b
Pipeline #156553 passed with stages
in 26 minutes and 24 seconds
......@@ -131,12 +131,17 @@ def solve_lyap_dense(A, E, B, trans=False, cont_time=True, options=None):
dico = 'C' if cont_time else 'D'
job = 'B'
if E is None:
ldwork = max(2*n*n, 3*n) if cont_time else 2*n*n+2*n
# slycot v. 0.4.0 does not set ldwork correctly for dico='D'
# should be fixed in the next release
U = np.zeros((n, n))
X, scale, sep, ferr, _ = slycot.sb03md(n, C, A, U, dico, job=job, trana=trana, ldwork=ldwork)
_solve_check(A.dtype, 'slycot.sb03md', sep, ferr)
from packaging.version import parse
# branch off different slycot versions due to changes of sb03md call signature
if parse(slycot.version.version) < parse('0.5.0.0'):
U = np.zeros((n, n))
ldwork = max(2*n*n, 3*n) if cont_time else 2*n*n+2*n
# slycot v. 0.4.0 does not set ldwork correctly for dico='D'
X, scale, sep, ferr, _ = slycot.sb03md(n, C, A, U, dico, job=job, trana=trana, ldwork=ldwork)
_solve_check(A.dtype, 'slycot.sb03md', sep, ferr)
else:
_, _, X, scale, sep, ferr, _ = slycot.sb03md57(A, C=C, dico=dico, job=job, trana=trana)
_solve_check(A.dtype, 'slycot.sb03md57', sep, ferr)
else:
fact = 'N'
uplo = 'L'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment