Skip to content

Commit

Permalink
Merge pull request #176 from bnavigator/SLICOT-5.8
Browse files Browse the repository at this point in the history
Update to SLICOT-Reference  v5.8
  • Loading branch information
bnavigator authored Jun 10, 2022
2 parents 01f7134 + afc0294 commit 4f98dac
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 31 deletions.
20 changes: 19 additions & 1 deletion slycot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# RvP, 180710

#
set(SLICOT_FSOURCE
set(SLICOT_FSOURCE

src/SLICOT-Reference/src/AB01MD.f
src/SLICOT-Reference/src/AB01ND.f
Expand Down Expand Up @@ -106,6 +106,7 @@ src/SLICOT-Reference/src/MA01BD.f
src/SLICOT-Reference/src/MA01BZ.f
src/SLICOT-Reference/src/MA01CD.f
src/SLICOT-Reference/src/MA02AD.f
src/SLICOT-Reference/src/MA02AZ.f
src/SLICOT-Reference/src/MA02BD.f
src/SLICOT-Reference/src/MA02BZ.f
src/SLICOT-Reference/src/MA02CD.f
Expand Down Expand Up @@ -157,6 +158,8 @@ src/SLICOT-Reference/src/MB01TD.f
src/SLICOT-Reference/src/MB01UD.f
src/SLICOT-Reference/src/MB01UW.f
src/SLICOT-Reference/src/MB01UX.f
src/SLICOT-Reference/src/MB01UY.f
src/SLICOT-Reference/src/MB01UZ.f
src/SLICOT-Reference/src/MB01VD.f
src/SLICOT-Reference/src/MB01WD.f
src/SLICOT-Reference/src/MB01XD.f
Expand Down Expand Up @@ -253,13 +256,16 @@ src/SLICOT-Reference/src/MB03QW.f
src/SLICOT-Reference/src/MB03QX.f
src/SLICOT-Reference/src/MB03QY.f
src/SLICOT-Reference/src/MB03RD.f
src/SLICOT-Reference/src/MB03RW.f
src/SLICOT-Reference/src/MB03RX.f
src/SLICOT-Reference/src/MB03RY.f
src/SLICOT-Reference/src/MB03RZ.f
src/SLICOT-Reference/src/MB03SD.f
src/SLICOT-Reference/src/MB03TD.f
src/SLICOT-Reference/src/MB03TS.f
src/SLICOT-Reference/src/MB03UD.f
src/SLICOT-Reference/src/MB03VD.f
src/SLICOT-Reference/src/MB03VW.f
src/SLICOT-Reference/src/MB03VY.f
src/SLICOT-Reference/src/MB03WA.f
src/SLICOT-Reference/src/MB03WD.f
Expand Down Expand Up @@ -427,10 +433,12 @@ src/SLICOT-Reference/src/SB03MX.f
src/SLICOT-Reference/src/SB03MY.f
src/SLICOT-Reference/src/SB03OD.f
src/SLICOT-Reference/src/SB03OR.f
src/SLICOT-Reference/src/SB03OS.f
src/SLICOT-Reference/src/SB03OT.f
src/SLICOT-Reference/src/SB03OU.f
src/SLICOT-Reference/src/SB03OV.f
src/SLICOT-Reference/src/SB03OY.f
src/SLICOT-Reference/src/SB03OZ.f
src/SLICOT-Reference/src/SB03PD.f
src/SLICOT-Reference/src/SB03QD.f
src/SLICOT-Reference/src/SB03QX.f
Expand Down Expand Up @@ -512,11 +520,15 @@ src/SLICOT-Reference/src/SG03AD.f
src/SLICOT-Reference/src/SG03AX.f
src/SLICOT-Reference/src/SG03AY.f
src/SLICOT-Reference/src/SG03BD.f
src/SLICOT-Reference/src/SG03BR.f
src/SLICOT-Reference/src/SG03BS.f
src/SLICOT-Reference/src/SG03BT.f
src/SLICOT-Reference/src/SG03BU.f
src/SLICOT-Reference/src/SG03BV.f
src/SLICOT-Reference/src/SG03BW.f
src/SLICOT-Reference/src/SG03BX.f
src/SLICOT-Reference/src/SG03BY.f
src/SLICOT-Reference/src/SG03BZ.f
src/SLICOT-Reference/src/TB01ID.f
src/SLICOT-Reference/src/TB01IZ.f
src/SLICOT-Reference/src/TB01KD.f
Expand Down Expand Up @@ -580,11 +592,17 @@ src/SLICOT-Reference/src/TG01HY.f
src/SLICOT-Reference/src/TG01ID.f
src/SLICOT-Reference/src/TG01JD.f
src/SLICOT-Reference/src/TG01JY.f
src/SLICOT-Reference/src/TG01KD.f
src/SLICOT-Reference/src/TG01KZ.f
src/SLICOT-Reference/src/TG01LD.f
src/SLICOT-Reference/src/TG01LY.f
src/SLICOT-Reference/src/TG01MD.f
src/SLICOT-Reference/src/TG01ND.f
src/SLICOT-Reference/src/TG01NX.f
src/SLICOT-Reference/src/TG01OA.f
src/SLICOT-Reference/src/TG01OB.f
src/SLICOT-Reference/src/TG01OD.f
src/SLICOT-Reference/src/TG01OZ.f
src/SLICOT-Reference/src/TG01PD.f
src/SLICOT-Reference/src/TG01QD.f
src/SLICOT-Reference/src/TG01WD.f
Expand Down
2 changes: 1 addition & 1 deletion slycot/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def mb03rd(n, A, X=None, jobx='U', sort='N', pmax=1.0, tol=0.0):
To reduce a matrix `A` in real Schur form to a block-diagonal form
using well-conditioned non-orthogonal similarity transformations.
The condition numbers of the transformations used for reduction
are roughly bounded by `pmax`*`pmax`, where `pmax` is a given value.
are roughly bounded by `pmax`, where `pmax` is a given value.
The transformations are optionally postmultiplied in a given
matrix `X`. The real Schur form is optionally ordered, so that
clustered eigenvalues are grouped in the same block.
Expand Down
2 changes: 1 addition & 1 deletion slycot/src/SLICOT-Reference
Submodule SLICOT-Reference updated 1124 files
2 changes: 1 addition & 1 deletion slycot/src/synthesis.pyf
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ subroutine sb03od(dico,fact,trans,n,m,a,lda,q,ldq,b,ldb,scale,wr,wi,dwork,ldwork
double precision intent(out),dimension(n),depend(n) :: wr
double precision intent(out),dimension(n),depend(n) :: wi
double precision intent(hide,cache),dimension(ldwork) :: dwork
integer optional,check(ldwork>=max(1,4*n + min(m,n))),depend(n,m) :: ldwork=max(1,4*n + min(m,n))
integer optional,check(ldwork>=max(1,4*n)),depend(n,m) :: ldwork=max(1,4*n)
integer intent(out) :: info
end subroutine sb03od
subroutine sb04md(n,m,a,lda,b,ldb,c,ldc,z,ldz,iwork,dwork,ldwork,info) ! in SB04MD.f
Expand Down
48 changes: 23 additions & 25 deletions slycot/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None):
set less than or equal to 1 to avoid overflow in X. If matrix B
has full rank then the solution matrix X will be positive-definite
and hence the Cholesky factor U will be nonsingular, but if B is
rank deficient then X may be only positive semi-definite and U
rank deficient, then X may be only positive semi-definite and U
will be singular.
In the case of equation (1) the matrix A must be stable (that
Expand All @@ -850,28 +850,28 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None):
Parameters
----------
n : int
The order of the matrix A and the number of columns in
matrix op(B). n >= 0.
The order of the matrix A and the number of columns of
the matrix op(B). n >= 0.
m : int
The number of rows in matrix op(B). m >= 0.
A : (n, n) array_like
On entry, the leading n-by-n part of this array must
contain the matrix A. If fact = 'F', then A contains
an upper quasi-triangular matrix S in Schur canonical
form; the elements below the upper Hessenberg part of the
array A are not referenced.
array A are then not referenced.
On exit, the leading n-by-n upper Hessenberg part of this
array contains the upper quasi-triangular matrix S in
Schur canonical form from the Shur factorization of A.
The contents of array A is not modified if fact = 'F'.
The contents of the array A is not modified if fact = 'F'.
Q : (n, n) array_like
On entry, if fact = 'F', then the leading n-by-n part of
this array must contain the orthogonal matrix Q of the
Schur factorization of A.
Otherwise, Q need not be set on entry.
On exit, the leading n-by-n part of this array contains
the orthogonal matrix Q of the Schur factorization of A.
The contents of array Q is not modified if fact = 'F'.
The contents of the array Q is not modified if fact = 'F'.
B : (m, n) array_like
On entry, if trans = 'N', the leading m-by-n part of this
array must contain the coefficient matrix B of the
Expand Down Expand Up @@ -901,7 +901,7 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None):
:= 'T': op(K) = K**T (Transpose).
ldwork : int, optional
The length of the array DWORK.
If m > 0, ldwork >= max(1, 4*n + min(m, n));
If m > 0, ldwork >= max(1, 4*n);
If m = 0, ldwork >= 1.
For optimum performance ldwork should sometimes be larger.
Expand All @@ -915,24 +915,15 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None):
The scale factor, scale, set less than or equal to 1 to
prevent the solution overflowing.
w : (n, ) complex ndarray
If fact = 'N', this array contains the eigenvalues of A.
The eigenvalues of A.
Raises
------
SlycotArithmeticError
:info = 3 and fact == 'F' and dico == 'C':
The Schur factor S supplied in the array A is not
stable (that is, one or more of the eigenvalues of
S has a non-negative real part)
:info = 3 and dico == 'D':
The Schur factor S
supplied in the array A is not convergent (that is,
one or more of the eigenvalues of S lies outside the
unit circle)
:info = 4:
FACT = 'F' and the Schur factor S supplied in
the array A has two or more consecutive non-zero
elements on the first sub-diagonal, so that there is
elements on the first subdiagonal, so that there is
a block larger than 2-by-2 on the diagonal
:info = 5:
FACT = 'F' and the Schur factor S supplied in
Expand Down Expand Up @@ -977,14 +968,24 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None):
more of the eigenvalues of A lies outside the unit
circle); however, A still has been factored
and the eigenvalues of A are returned in WR and WI.
:info = 3 and fact == 'F' and dico == 'C':
The Schur factor S supplied in the array A is not
stable (that is, one or more of the eigenvalues of
S has a non-negative real part);
the eigenvalues of A are still returned in w.
:info = 3 and dico == 'D':
The Schur factor S supplied in the array A is not
convergent (that is, one or more of the eigenvalues
of S lies outside the unit circle);
the eigenvalues of A are still returned in w.
"""
hidden = ' (hidden by the wrapper)'
arg_list = ['dico','fact', 'trans', 'n', 'm', 'a', 'lda'+hidden, 'q',
'ldq'+hidden, 'b', 'ldb'+hidden, 'scale', 'wr'+hidden,
'wi'+hidden, 'dwork'+hidden, 'ldwork', 'info'+hidden]
if ldwork is None:
if m > 0:
ldwork = max(1,4*n + min(m,n))
ldwork = max(1,4*n)
elif m == 0:
ldwork = 1
if dico != 'C' and dico != 'D':
Expand Down Expand Up @@ -2333,9 +2334,6 @@ def sg03bd(n,m,A,E,Q,Z,B,dico,fact='N',trans='N',ldwork=None):
Hessenberg part of the array A are not referenced.
If fact = 'N', then the leading n-by-n part of this
array must contain the matrix A.
On exit, the leading n-by-n part of this array contains
the generalized Schur factor A_s of the matrix A. (A_s is
an upper quasitriangular matrix.)
E : (n, n) array_like
On entry, if fact = 'F', then the leading n-by-n upper
triangular part of this array must contain the
Expand Down Expand Up @@ -2407,9 +2405,9 @@ def sg03bd(n,m,A,E,Q,Z,B,dico,fact='N',trans='N',ldwork=None):
scale : float
The scale factor set to avoid overflow in U.
0 < scale <= 1.
alpha : (n, ) complex ndarray
lambda : (n, ) complex ndarray
If INFO = 0, 3, 5, 6, or 7, then
(alpha(j), j=1,...,n, are the
((j), j=1,...,n, are the
eigenvalues of the matrix pencil A - lambda * E.
Raises
Expand Down Expand Up @@ -2463,7 +2461,7 @@ def sg03bd(n,m,A,E,Q,Z,B,dico,fact='N',trans='N',ldwork=None):
alpha = _np.zeros(n,'complex64')
alpha.real = alphar[0:n]
alpha.imag = alphai[0:n]
return U,scale,alpha/beta
return U, scale, alpha/beta


def sb10fd(n,m,np,ncon,nmeas,gamma,A,B,C,D,tol=0.0,ldwork=None):
Expand Down
4 changes: 2 additions & 2 deletions slycot/tests/test_sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ def test_sb10fd_2():
'dico': 'C'}),
(synthesis.sb03od, SlycotResultWarning, [1, 2], {'dico': 'C',
'fact': 'N'}),
(synthesis.sb03od, SlycotResultWarning, [1, 2], {'dico': 'D',
(synthesis.sb03od, SlycotResultWarning, [1, 2, 3], {'dico': 'D',
'fact': 'N'}),
(synthesis.sb03od, SlycotArithmeticError, [3, 4, 5, 6], {'dico': 'D',
(synthesis.sb03od, SlycotArithmeticError, [4, 5, 6], {'dico': 'D',
'fact': 'F'}),
(synthesis.sb04md, SlycotArithmeticError, 2, {'m': 1}),
(synthesis.sb04qd, SlycotArithmeticError, 3, {'m': 2}),
Expand Down

0 comments on commit 4f98dac

Please sign in to comment.