Lapack Utilities
MatrixEquations.LapackUtil.tgsyl!
— Functiontgsyl!(A, B, C, D, E, F) -> (C, F, scale)
Solve the Sylvester system of matrix equations
AX - YB = scale*C
DX - YE = scale*F ,
where X
and Y
are unknown matrices, the pairs (A, D)
, (B, E)
and (C, F)
have the same sizes, and the pairs (A, D)
and (B, E)
are in generalized (real) Schur canonical form, i.e. A
, B
are upper quasi triangular and D
, E
are upper triangular. Returns X
(overwriting C
), Y
(overwriting F
) and scale
.
tgsyl!(trans, A, B, C, D, E, F) -> (C, F, scale)
Solve for trans = 'T'
and real matrices or for trans = 'C'
and complex matrices, the (adjoint) Sylvester system of matrix equations
A'X + D'Y = scale*C
XB' + YE' = scale*(-F) .
tgsyl!('N', A, B, C, D, E, F)
corresponds to the call tgsyl!(A, B, C, D, E, F)
.
Interface to the LAPACK subroutines DTGSYL/STGSYL/ZTGSYL/CTGSYL.
MatrixEquations.LapackUtil.lanv2
— Functionlanv2(A, B, C, D) -> (RT1R, RT1I, RT2R, RT2I, CS, SN)
Compute the Schur factorization of a real 2-by-2 nonsymmetric matrix [A,B;C,D]
in standard form. A
, B
, C
, D
are overwritten on output by the corresponding elements of the standardised Schur form. RT1R+im*RT1I
and RT2R+im*RT2I
are the resulting eigenvalues. CS
and SN
are the parameters of the rotation matrix. Interface to the LAPACK subroutines DLANV2/SLANV2.
MatrixEquations.LapackUtil.lag2
— Functionlag2(A, B, SAFMIN) -> (SCALE1, SCALE2, WR1, WR2, WI)
Compute the eigenvalues of a 2-by-2 generalized real eigenvalue problem for the matrix pair (A,B)
, with scaling as necessary to avoid over-/underflow. SAFMIN
is the smallest positive number s.t. 1/SAFMIN
does not overflow. If WI = 0
, WR1/SCALE1
and WR2/SCALE2
are the resulting real eigenvalues, while if WI <> 0
, then (WR1+/-im*WI)/SCALE1
are the resulting complex eigenvalues. Interface to the LAPACK subroutines DLAG2/SLAG2.
MatrixEquations.LapackUtil.ladiv
— Functionladiv(A, B, C, D) -> (P, Q)
Perform the complex division in real arithmetic
$P + iQ = \displaystyle\frac{A+iB}{C+iD}$
by avoiding unnecessary overflow. Interface to the LAPACK subroutines DLADIV/SLADIV.
MatrixEquations.LapackUtil.lacn2!
— Functionlacn2!(V, X, ISGN, EST, KASE, ISAVE ) -> (EST, KASE )
Estimate the 1-norm of a real
linear operator A
, using reverse communication by applying the operator or its transpose/adjoint to a vector. KASE
is a parameter to control the norm evaluation process as follows. On the initial call, KASE
should be 0
. On an intermediate return, KASE
will be 1
or 2
, indicating whether the real
vector X
should be overwritten by A * X
or A' * X
at the next call. On the final return, KASE
will again be 0
and EST
is an estimate (a lower bound) for the 1-norm of A
. V
is a real work vector, ISGN
is an integer work vector and ISAVE
is a 3-dimensional integer vector used to save information between the calls. Interface to the LAPACK subroutines DLACN2/SLACN2.
lacn2!(V, X, EST, KASE, ISAVE ) -> (EST, KASE )
Estimate the 1-norm of a complex
linear operator A
, using reverse communication by applying the operator or its adjoint to a vector. KASE
is a parameter to control the norm evaluation process as follows. On the initial call, KASE
should be 0
. On an intermediate return, KASE
will be 1
or 2
, indicating whether the complex
vector X
should be overwritten by A * X
or A' * X
at the next call. On the final return, KASE
will again be 0
and EST
is an estimate (a lower bound) for the 1-norm of A
. V
is a complex work vector and ISAVE
is a 3-dimensional integer vector used to save information between the calls. Interface to the LAPACK subroutines ZLACN2/CLACN2.