Developer Reference for Intel® oneAPI Math Kernel Library for C
?tgsja
Computes the generalized SVD of two upper triangular or trapezoidal matrices.
Syntax
lapack_int LAPACKE_stgsja ( intmatrix_layout , charjobu , charjobv , charjobq , lapack_intm , lapack_intp , lapack_intn , lapack_intk , lapack_intl , float*a , lapack_intlda , float*b , lapack_intldb , floattola , floattolb , float*alpha , float*beta , float*u , lapack_intldu , float*v , lapack_intldv , float*q , lapack_intldq , lapack_int*ncycle );
lapack_int LAPACKE_dtgsja ( intmatrix_layout , charjobu , charjobv , charjobq , lapack_intm , lapack_intp , lapack_intn , lapack_intk , lapack_intl , double*a , lapack_intlda , double*b , lapack_intldb , doubletola , doubletolb , double*alpha , double*beta , double*u , lapack_intldu , double*v , lapack_intldv , double*q , lapack_intldq , lapack_int*ncycle );
lapack_int LAPACKE_ctgsja ( intmatrix_layout , charjobu , charjobv , charjobq , lapack_intm , lapack_intp , lapack_intn , lapack_intk , lapack_intl , lapack_complex_float*a , lapack_intlda , lapack_complex_float*b , lapack_intldb , floattola , floattolb , float*alpha , float*beta , lapack_complex_float*u , lapack_intldu , lapack_complex_float*v , lapack_intldv , lapack_complex_float*q , lapack_intldq , lapack_int*ncycle );
lapack_int LAPACKE_ztgsja ( intmatrix_layout , charjobu , charjobv , charjobq , lapack_intm , lapack_intp , lapack_intn , lapack_intk , lapack_intl , lapack_complex_double*a , lapack_intlda , lapack_complex_double*b , lapack_intldb , doubletola , doubletolb , double*alpha , double*beta , lapack_complex_double*u , lapack_intldu , lapack_complex_double*v , lapack_intldv , lapack_complex_double*q , lapack_intldq , lapack_int*ncycle );
Include Files
mkl.h
Description
stgsja dtgsja ctgsja ztgsja tgsja
The routine computes the generalized singular value decomposition (GSVD) of two real/complex upper triangular (or trapezoidal) matrices A and B . On entry, it is assumed that matrices A and B have the following forms, which may be obtained by the preprocessing subroutine ggsvp from a general m -by- n matrix A and p -by- n matrix B :
where the k -by- k matrix A12 and l -by- l matrix B13 are nonsingular upper triangular; A23 is l -by- l upper triangular if m-k-l≥0 , otherwise A23 is ( m - k )-by- l upper trapezoidal.
On exit,
U^{H}*A*Q = D_{1}*(0 R) , V^{H}*B*Q = D_{2}*(0 R) ,
where U , V and Q are orthogonal/unitary matrices, R is a nonsingular upper triangular matrix, and D1 and D2 are “diagonal” matrices, which are of the following structures:
If m-k-l≥0 ,
where
C = diag(alpha(k+1),...,alpha(k+l)alpha[k],...,alpha[k+l-1])
S = diag(beta(k+1),...,beta(k+l)beta[k],...,beta[k+l-1])
C^{2} + S^{2} = I
R is stored in a (1: k + l , n - k - l +1: n ) on exit.
If m-k-l < 0 ,
where
C = diag(alpha(k+1),...,alpha(m)alpha[k],...,alpha[m-1]) ,
S = diag(beta(k+1),...,beta(m)beta[k],...,beta[m-1]) ,
C^{2} + S^{2} = I
On exit,
is stored in a (1: m , n - k - l +1: n ) and R33 is stored in b ( m - k +1: l , n + m - k - l +1: n ).
The computation of the orthogonal/unitary transformation matrices U , V or Q is optional. These matrices may either be formed explicitly, or they may be postmultiplied into input matrices U1 , V1 , or Q1 .
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
jobu
Must be ‘U’ , ‘I’ , or ‘N’ .
If jobu = 'U' , u must contain an orthogonal/unitary matrix U1 on entry.
If jobu = 'I' , u is initialized to the unit matrix.
If jobu = 'N' , u is not computed.
jobv
Must be ‘V’ , ‘I’ , or ‘N’ .
If jobv = 'V' , v must contain an orthogonal/unitary matrix V1 on entry.
If jobv = 'I' , v is initialized to the unit matrix.
If jobv = 'N' , v is not computed.
jobq
Must be ‘Q’ , ‘I’ , or ‘N’ .
If jobq = 'Q' , q must contain an orthogonal/unitary matrix Q1 on entry.
If jobq = 'I' , q is initialized to the unit matrix.
If jobq = 'N' , q is not computed.
m
The number of rows of the matrix A ( m ≥ 0).
p
The number of rows of the matrix B ( p ≥ 0).
n
The number of columns of the matrices A and B ( n ≥ 0).
k , l
Specify the subblocks in the input matrices A and B , whose GSVD is computed.
- a , b , u , v , q , work
-
REAL for stgsja DOUBLE PRECISION for dtgsja COMPLEX for ctgsja DOUBLE COMPLEX for ztgsja . Arrays:
a (size at least max(1, lda * n ) for column major layout and max(1, lda * m ) for row major layout) contains the m -by- n matrix A .
The second dimension of a must be at least max(1, n ).
b (size at least max(1, ldb * n ) for column major layout and max(1, ldb * p ) for row major layout) contains the p -by- n matrix B .
The second dimension of b must be at least max(1, n ).
If jobu = 'U' , u (size max(1, ldu * m )) must contain a matrix U1 (usually the orthogonal/unitary matrix returned by ?ggsvp ).
The second dimension of u must be at least max(1, m ).
If jobv = 'V' , v (size at least max(1, ldv * p )) must contain a matrix V1 (usually the orthogonal/unitary matrix returned by ?ggsvp ).
The second dimension of v must be at least max(1, p ).
If jobq = 'Q' , q (size at least max(1, ldq * n )) must contain a matrix Q1 (usually the orthogonal/unitary matrix returned by ?ggsvp ).
The second dimension of q must be at least max(1, n ). work (* ) is a workspace array. The dimension of work must be at least max(1, 2 n ).
lda
The leading dimension of a ; at least max(1, m ) for column major layout and max(1, n ) for row major layout .
ldb
The leading dimension of b ; at least max(1, p ) for column major layout and max(1, n ) for row major layout .
ldu
The leading dimension of the array u .
ldu≥ max(1, m) if jobu = 'U' ; ldu≥ 1 otherwise.
ldv
The leading dimension of the array v .
ldv≥ max(1, p) if jobv = 'V' ; ldv≥ 1 otherwise.
ldq
The leading dimension of the array q .
ldq≥ max(1, n) if jobq = 'Q' ; ldq≥ 1 otherwise.
- tola , tolb
-
REAL for single-precision flavors DOUBLE PRECISION for double-precision flavors. tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz iteration procedure. Generally, they are the same as used in ?ggsvp : tola = max(m, n)*|A|*MACHEPS , tolb = max(p, n)*|B|*MACHEPS .
Output Parameters
- a
-
On exit, a ( n - k +1: n , 1:min( k + l , m )) contains the triangular matrix R or part of R .
- b
-
On exit, if necessary, b ( m - k +1: l , n + m - k - l +1: n )) contains a part of R .
- alpha , beta
-
REAL for single-precision flavors DOUBLE PRECISION for double-precision flavors. Arrays, size at least max(1, n ). Contain the generalized singular value pairs of A and B : alpha(1:k) = 1 , beta(1:k) = 0 , and if m-k-l≥ 0 , alpha(k+1:k+l) = diag(C) , beta(k+1:k+l) = diag(S) , or if m-k-l < 0 , alpha(k+1:m)= diag(C) , alpha(m+1:k+l)=0beta(k+1:m) = diag(S) , beta(m+1:k+l) = 1 . Furthermore, if k+l < n , alpha(k+l+1:n)= 0 and beta(k+l+1:n) = 0 .
- u
-
If jobu = 'I' , u contains the orthogonal/unitary matrix U . If jobu = 'U' , u contains the product U1*U . If jobu = 'N' , u is not referenced.
- v
-
If jobv = 'I' , v contains the orthogonal/unitary matrix U . If jobv = 'V' , v contains the product V1*V . If jobv = 'N' , v is not referenced.
- q
-
If jobq = 'I' , q contains the orthogonal/unitary matrix U . If jobq = 'Q' , q contains the product Q1*Q . If jobq = 'N' , q is not referenced.
ncycle
The number of cycles required for convergence.
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = -i , the i -th parameter had an illegal value.
If info = 1 , the procedure does not converge after MAXIT cycles.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.