Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?ggrqf

Computes the generalized RQ factorization of two matrices.

Syntax

call sggrqf (m, p, n, a, lda, taua, b, ldb, taub, work, lwork, info)

call dggrqf (m, p, n, a, lda, taua, b, ldb, taub, work, lwork, info)

call cggrqf (m, p, n, a, lda, taua, b, ldb, taub, work, lwork, info)

call zggrqf (m, p, n, a, lda, taua, b, ldb, taub, work, lwork, info)

call ggrqf(a, b [,taua] [,taub] [,info])

Include Files

  • mkl.fi, lapack.f90

Description

The routine forms the generalized RQ factorization of an m-by-n matrix A and an p-by-n matrix B as A = R*Q, B = Z*T*Q, where Q is an n-by-n orthogonal/unitary matrix, Z is a p-by-p orthogonal/unitary matrix, and R and T assume one of the forms:


Equation

or


Equation

where R11 or R21 is upper triangular, and


Equation

or


Equation

where T11 is upper triangular.

In particular, if B is square and nonsingular, the GRQ factorization of A and B implicitly gives the RQ factorization of A*B-1 as:

A*B-1 = (R*T-1)*ZT (for real flavors) or A*B-1 = (R*T-1)*ZH (for complex flavors).

Input Parameters

m

INTEGER. The number of rows of the matrix A (m 0).

p

INTEGER. The number of rows in B (p 0).

n

INTEGER. The number of columns of the matrices A and B (n 0).

a, b, work

REAL for sggrqf

DOUBLE PRECISION for dggrqf

COMPLEX for cggrqf

DOUBLE COMPLEX for zggrqf.

Arrays:

a(lda,*) contains the m-by-n matrix A.

The second dimension of a must be at least max(1, n).

b(ldb,*) contains the p-by-n matrix B.

The second dimension of b must be at least max(1, n).

work is a workspace array, its dimension max(1, lwork).

lda

INTEGER. The leading dimension of a; at least max(1, m).

ldb

INTEGER. The leading dimension of b; at least max(1, p).

lwork

INTEGER. The size of the work array; must be at least max(1, n, m, p).

If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.

See Application Notes for the suggested value of lwork.

Output Parameters

a, b

Overwritten by the factorization data as follows:

on exit, if mn, the upper triangle of the subarray a(1:m, n-m+1:n ) contains the m-by-m upper triangular matrix R;

if m > n, the elements on and above the (m-n)th subdiagonal contain the m-by-n upper trapezoidal matrix R;

the remaining elements, with the array taua, represent the orthogonal/unitary matrix Q as a product of elementary reflectors.

The elements on and above the diagonal of the array b contain the min(p,n)-by-n upper trapezoidal matrix T (T is upper triangular if pn); the elements below the diagonal, with the array taub, represent the orthogonal/unitary matrix Z as a product of elementary reflectors.

taua, taub

REAL for sggrqf

DOUBLE PRECISION for dggrqf

COMPLEX for cggrqf

DOUBLE COMPLEX for zggrqf.

Arrays, size at least max (1, min(m, n)) for taua and at least max (1, min(p, n)) for taub.

The array taua contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix Q.

The array taub contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix Z.

work(1)

If info = 0, on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.

info

INTEGER.

If info = 0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

LAPACK 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see LAPACK 95 Interface Conventions.

Specific details for the routine ggrqf interface are the following:

a

Holds the matrix A of size (m,n).

b

Holds the matrix A of size (p,n).

taua

Holds the vector of length min(m,n).

taub

Holds the vector of length min(p,n).

Application Notes

The matrix Q is represented as a product of elementary reflectors

Q = H(1)H(2)...H(k), where k = min(m,n).

Each H(i) has the form

H(i) = I - taua*v*vT for real flavors, or

H(i) = I - taua*v*vH for complex flavors,

where taua is a real/complex scalar, and v is a real/complex vector with vn - k + i = 1, vn - k + i + 1:n = 0.

On exit, v1:n - k + i - 1 is stored in a(m-k+i,1:n-k+i-1) and taua is stored in taua(i).

The matrix Z is represented as a product of elementary reflectors

Z = H(1)H(2)...H(k), where k = min(p,n).

Each H(i) has the form

H(i) = I - taub*v*vT for real flavors, or

H(i) = I - taub*v*vH for complex flavors,

where taub is a real/complex scalar, and v is a real/complex vector with v1:i - 1 = 0, vi = 1.

On exit, vi + 1:p is stored in b(i+1:p, i) and taub is stored in taub(i).

For better performance, try using

lwork max(n,m, p)*max(nb1,nb2,nb3),

where nb1 is the optimal blocksize for the RQ factorization of an m-by-n matrix, nb2 is the optimal blocksize for the QR factorization of an p-by-n matrix, and nb3 is the optimal blocksize for a call of ?ormrq/?unmrq.

If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set lwork= -1.

If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value described, the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array work on exit. Use this value (work(1)) for subsequent runs.

If you set lwork= -1, the routine returns immediately and provides the recommended workspace in the first element of the corresponding array (work). This operation is called a workspace query.

Note that if you set lwork to less than the minimal required value and not -1, the routine returns immediately with an error exit and does not provide any information on the recommended workspace.