diff --git a/slycot/CMakeLists.txt b/slycot/CMakeLists.txt index 2276d8b4..f656c326 100644 --- a/slycot/CMakeLists.txt +++ b/slycot/CMakeLists.txt @@ -4,7 +4,7 @@ # RvP, 180710 # -set(SLICOT_FSOURCE +set(SLICOT_FSOURCE src/SLICOT-Reference/src/AB01MD.f src/SLICOT-Reference/src/AB01ND.f @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/slycot/math.py b/slycot/math.py index 336b4b4b..ae9aab18 100644 --- a/slycot/math.py +++ b/slycot/math.py @@ -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. diff --git a/slycot/src/SLICOT-Reference b/slycot/src/SLICOT-Reference index 162552c8..c1104834 160000 --- a/slycot/src/SLICOT-Reference +++ b/slycot/src/SLICOT-Reference @@ -1 +1 @@ -Subproject commit 162552c8783101b0b765b9b039efa328038f311b +Subproject commit c1104834c7348b3412973bd86b063faa74219003 diff --git a/slycot/src/synthesis.pyf b/slycot/src/synthesis.pyf index 27eb6e39..a84cd03f 100644 --- a/slycot/src/synthesis.pyf +++ b/slycot/src/synthesis.pyf @@ -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 diff --git a/slycot/synthesis.py b/slycot/synthesis.py index f2117bb3..0ffbbd93 100644 --- a/slycot/synthesis.py +++ b/slycot/synthesis.py @@ -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 @@ -850,8 +850,8 @@ 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 @@ -859,11 +859,11 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None): 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 @@ -871,7 +871,7 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None): 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 @@ -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. @@ -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 @@ -977,6 +968,16 @@ 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', @@ -984,7 +985,7 @@ def sb03od(n,m,A,Q,B,dico,fact='N',trans='N',ldwork=None): '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': @@ -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 @@ -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 @@ -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): diff --git a/slycot/tests/test_sb.py b/slycot/tests/test_sb.py index 2446405d..00e406db 100644 --- a/slycot/tests/test_sb.py +++ b/slycot/tests/test_sb.py @@ -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}),