NAG CL Interface
f08yvc (ztgsyl)

Settings help

CL Name Style:


1 Purpose

f08yvc solves the generalized complex triangular Sylvester equations.

2 Specification

#include <nag.h>
void  f08yvc (Nag_OrderType order, Nag_TransType trans, Integer ijob, Integer m, Integer n, const Complex a[], Integer pda, const Complex b[], Integer pdb, Complex c[], Integer pdc, const Complex d[], Integer pdd, const Complex e[], Integer pde, Complex f[], Integer pdf, double *scale, double *dif, NagError *fail)
The function may be called by the names: f08yvc, nag_lapackeig_ztgsyl or nag_ztgsyl.

3 Description

f08yvc solves either the generalized complex Sylvester equations
AR-LB =αC DR-LE =αF, (1)
or the equations
AHR+DHL =αC RBH+LEH =-αF, (2)
where the pair (A,D) are given m×m matrices in generalized Schur form, (B,E) are given n×n matrices in generalized Schur form and (C,F) are given m×n matrices. The pair (R,L) are the m×n solution matrices, and α is an output scaling factor determined by the function to avoid overflow in computing (R,L).
Equations (1) are equivalent to equations of the form
Zx=αb ,  
where
Z = ( IA-BHI ID-EHI )  
and is the Kronecker product. Equations (2) are then equivalent to
ZHy = αb .  
The pair (S,T) are in generalized Schur form if S and T are upper triangular as returned, for example, by f08xqc, or f08xsc with job=Nag_Schur.
Optionally, the function estimates Dif[(A,D),(B,E)], the separation between the matrix pairs (A,D) and (B,E), which is the smallest singular value of Z. The estimate can be based on either the Frobenius norm, or the 1-norm. The 1-norm estimate can be three to ten times more expensive than the Frobenius norm estimate, but makes the condition estimation uniform with the nonsymmetric eigenproblem. The Frobenius norm estimate provides a low cost, but equally reliable estimate. For more information see Sections 2.4.8.3 and 4.11.1.3 of Anderson et al. (1999) and Kågström and Poromaa (1996).

4 References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia https://www.netlib.org/lapack/lug
Kågström B (1994) A perturbation analysis of the generalized Sylvester equation (AR-LB,DR-LE)=(c,F) SIAM J. Matrix Anal. Appl. 15 1045–1060
Kågström B and Poromaa P (1996) LAPACK-style algorithms and software for solving the generalized Sylvester equation and estimating the separation between regular matrix pairs ACM Trans. Math. Software 22 78–103

5 Arguments

1: order Nag_OrderType Input
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by order=Nag_RowMajor. See Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2: trans Nag_TransType Input
On entry: if trans=Nag_NoTrans, solve the generalized Sylvester equation (1).
If trans=Nag_ConjTrans, solve the ‘conjugate transposed’ system (2).
Constraint: trans=Nag_NoTrans or Nag_ConjTrans.
3: ijob Integer Input
On entry: specifies what kind of functionality is to be performed when trans=Nag_NoTrans.
ijob=0
Solve (1) only.
ijob=1
The functionality of ijob=0 and 3.
ijob=2
The functionality of ijob=0 and 4.
ijob=3
Only an estimate of Dif [(A,D),(B,E)] is computed based on the Frobenius norm.
ijob=4
Only an estimate of Dif [(A,D),(B,E)] is computed based on the 1-norm.
If trans=Nag_ConjTrans, ijob is not referenced.
Constraint: if trans=Nag_NoTrans, 0ijob4.
4: m Integer Input
On entry: m, the order of the matrices A and D, and the row dimension of the matrices C, F, R and L.
Constraint: m>0.
5: n Integer Input
On entry: n, the order of the matrices B and E, and the column dimension of the matrices C, F, R and L.
Constraint: n>0.
6: a[dim] const Complex Input
Note: the dimension, dim, of the array a must be at least max(1,pda×m).
The (i,j)th element of the matrix A is stored in
  • a[(j-1)×pda+i-1] when order=Nag_ColMajor;
  • a[(i-1)×pda+j-1] when order=Nag_RowMajor.
On entry: the upper triangular matrix A.
7: pda Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array a.
Constraint: pdamax(1,m).
8: b[dim] const Complex Input
Note: the dimension, dim, of the array b must be at least max(1,pdb×n).
The (i,j)th element of the matrix B is stored in
  • b[(j-1)×pdb+i-1] when order=Nag_ColMajor;
  • b[(i-1)×pdb+j-1] when order=Nag_RowMajor.
On entry: the upper triangular matrix B.
9: pdb Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array b.
Constraint: pdbmax(1,n).
10: c[dim] Complex Input/Output
Note: the dimension, dim, of the array c must be at least
  • max(1,pdc×n) when order=Nag_ColMajor;
  • max(1,m×pdc) when order=Nag_RowMajor.
The (i,j)th element of the matrix C is stored in
  • c[(j-1)×pdc+i-1] when order=Nag_ColMajor;
  • c[(i-1)×pdc+j-1] when order=Nag_RowMajor.
On entry: contains the right-hand-side matrix C.
On exit: if ijob=0, 1 or 2, c is overwritten by the solution matrix R.
If trans=Nag_NoTrans and ijob=3 or 4, c holds R, the solution achieved during the computation of the Dif estimate.
11: pdc Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array c.
Constraints:
  • if order=Nag_ColMajor, pdcmax(1,m);
  • if order=Nag_RowMajor, pdcmax(1,n).
12: d[dim] const Complex Input
Note: the dimension, dim, of the array d must be at least max(1,pdd×m).
The (i,j)th element of the matrix D is stored in
  • d[(j-1)×pdd+i-1] when order=Nag_ColMajor;
  • d[(i-1)×pdd+j-1] when order=Nag_RowMajor.
On entry: the upper triangular matrix D.
13: pdd Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array d.
Constraint: pddmax(1,m).
14: e[dim] const Complex Input
Note: the dimension, dim, of the array e must be at least max(1,pde×n).
The (i,j)th element of the matrix E is stored in
  • e[(j-1)×pde+i-1] when order=Nag_ColMajor;
  • e[(i-1)×pde+j-1] when order=Nag_RowMajor.
On entry: the upper triangular matrix E.
15: pde Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array e.
Constraint: pdemax(1,n).
16: f[dim] Complex Input/Output
Note: the dimension, dim, of the array f must be at least
  • max(1,pdf×n) when order=Nag_ColMajor;
  • max(1,m×pdf) when order=Nag_RowMajor.
The (i,j)th element of the matrix F is stored in
  • f[(j-1)×pdf+i-1] when order=Nag_ColMajor;
  • f[(i-1)×pdf+j-1] when order=Nag_RowMajor.
On entry: contains the right-hand side matrix F.
On exit: if ijob=0, 1 or 2, f is overwritten by the solution matrix L.
If trans=Nag_NoTrans and ijob=3 or 4, f holds L, the solution achieved during the computation of the Dif estimate.
17: pdf Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array f.
Constraints:
  • if order=Nag_ColMajor, pdfmax(1,m);
  • if order=Nag_RowMajor, pdfmax(1,n).
18: scale double * Output
On exit: α, the scaling factor in (1) or (2).
If 0<scale<1, c and f hold the solutions R and L, respectively, to a slightly perturbed system but the input arrays a, b, d and e have not been changed.
If scale=0, c and f hold the solutions R and L, respectively, to the homogeneous system with C=F=0. In this case dif is not referenced.
Normally, scale=1.
19: dif double * Output
On exit: the estimate of Dif. If ijob=0, dif is not referenced.
20: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_EIGENVALUES
(A,D) and (B,E) have common or close eigenvalues and so no solution could be computed.
NE_ENUM_INT
On entry, trans=value and ijob=value.
Constraint: if trans=Nag_NoTrans, 0ijob4.
NE_INT
On entry, m=value.
Constraint: m>0.
On entry, n=value.
Constraint: n>0.
On entry, pda=value.
Constraint: pda>0.
On entry, pdb=value.
Constraint: pdb>0.
On entry, pdc=value.
Constraint: pdc>0.
On entry, pdd=value.
Constraint: pdd>0.
On entry, pde=value.
Constraint: pde>0.
On entry, pdf=value.
Constraint: pdf>0.
NE_INT_2
On entry, pda=value and m=value.
Constraint: pdamax(1,m).
On entry, pdb=value and n=value.
Constraint: pdbmax(1,n).
On entry, pdc=value and m=value.
Constraint: pdcmax(1,m).
On entry, pdc=value and n=value.
Constraint: pdcmax(1,n).
On entry, pdd=value and m=value.
Constraint: pddmax(1,m).
On entry, pde=value and n=value.
Constraint: pdemax(1,n).
On entry, pdf=value and m=value.
Constraint: pdfmax(1,m).
On entry, pdf=value and n=value.
Constraint: pdfmax(1,n).
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.

7 Accuracy

See Kågström (1994) for a perturbation analysis of the generalized Sylvester equation.

8 Parallelism and Performance

f08yvc makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The total number of floating-point operations needed to solve the generalized Sylvester equations is approximately 8mn(n+m). The Frobenius norm estimate of Dif does not require additional significant computation, but the 1-norm estimate is typically five times more expensive.
The real analogue of this function is f08yhc.

10 Example

This example solves the generalized Sylvester equations
AR-LB =αC DR-LE =αF,  
where
A = ( 4.0+4.0i 1.0+1.0i 1.0+1.0i 2.0-1.0i 0.0i+0.0 2.0+1.0i 1.0+1.0i 1.0+1.0i 0.0i+0.0 0.0i+0.0 2.0-1.0i 1.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 6.0-2.0i ) ,  
B = ( 2.0 1.0+1.0i 1.0+1.0i 3.0-1.0i 0.0 1.0i+0.0 2.0+1.0i 1.0+1.0i 0.0 0.0i+0.0 1.0i+0.0 1.0+1.0i 0.0 0.0i+0.0 0.0i+0.0 2.0i+0.0 ) ,  
D = ( 1.0+1.0i 1.0-1.0i 1.0+1.0i 1.0-1.0i 0.0i+0.0 6.0-4.0i 1.0-1.0i 1.0+1.0i 0.0i+0.0 0.0i+0.0 2.0+4.0i 1.0-1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 2.0+3.0i ) ,  
E = ( 1.0 1.0+1.0i 1.0-1.0i 1.0+1.0i 0.0 2.0i+0.0 1.0+1.0i 1.0-1.0i 0.0 0.0i+0.0 2.0i+0.0 1.0+1.0i 0.0 0.0i+0.0 0.0i+0.0 1.0i+0.0 ) ,  
C = ( -13.0+9.0i 2.0+8.0i -2.0+8.0i -2.0+5.0i -9.0-1.0i 0.0+5.0i -7.0-3.0i -6.0-0.0i -1.0+1.0i 4.0+2.0i 4.0-5.0i 9.0-5.0i -6.0+6.0i 9.0+1.0i -2.0+4.0i 22.0-8.0i )  
and
F = ( -6.0+05.0i 4.0-4.0i -3.0+11.0i 3.0-07.0i -5.0+11.0i 12.0-4.0i -2.0+02.0i 0.0+14.0i -5.0-01.0i 0.0+4.0i -2.0+10.0i 3.0-01.0i -6.0-02.0i 1.0+1.0i -7.0-03.0i 4.0+07.0i ) .  

10.1 Program Text

Program Text (f08yvce.c)

10.2 Program Data

Program Data (f08yvce.d)

10.3 Program Results

Program Results (f08yvce.r)