ggrqf#

Functions

void sggrqf(
    const INT           m,
    const INT           p,
    const INT           n,
          f32* restrict A,
    const INT           lda,
          f32* restrict taua,
          f32* restrict B,
    const INT           ldb,
          f32* restrict taub,
          f32* restrict work,
    const INT           lwork,
          INT*          info
);
void sggrqf(const INT m, const INT p, const INT n, f32 *restrict A, const INT lda, f32 *restrict taua, f32 *restrict B, const INT ldb, f32 *restrict taub, f32 *restrict work, const INT lwork, INT *info)#

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

if M <= N,  R = ( 0  R12 ) M,   or if M > N,  R = ( R11 ) M-N,
                 N-M  M                           ( R21 ) N
                                                     N

where R12 or R21 is upper triangular, and

if P >= N,  T = ( T11 ) N  ,   or if P < N,  T = ( T11  T12 ) P,
                (  0  ) P-N                         P   N-P
                   N

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*inv(B): A*inv(B) = (R*inv(T))*Z**T where inv(B) denotes the inverse of the matrix B, and Z**T denotes the transpose of the matrix Z.

Further Details:

The matrix Q is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taua * v * v**T

where taua is a real scalar, and v is a real vector with
v[n-k+i+1:n-1] = 0 and v[n-k+i] = 1; v[0:n-k+i-1] is stored on exit in
A[m-k+i, 0:n-k+i-1], and taua in taua[i].

To form Q explicitly, use LAPACK subroutine SORGRQ. To use Q to update another matrix, use LAPACK subroutine SORMRQ.

The matrix Z is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taub * v * v**T

where taub is a real scalar, and v is a real vector with
v[0:i-1] = 0 and v[i] = 1; v[i+1:p-1] is stored on exit in
B[i+1:p-1, i], and taub in taub[i].

To form Z explicitly, use LAPACK subroutine SORGQR. To use Z to update another matrix, use LAPACK subroutine SORMQR.

Parameters

in
m

The number of rows of the matrix A. m>=0.

in
p

The number of rows of the matrix B. p>=0.

in
n

The number of columns of the matrices A and B. n>=0.

inout
A

On entry, the m-by-n matrix A. On exit, if m<=n, the upper triangle of the subarray A[0:m-1, n-m:n-1] 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 matrix Q as a product of elementary reflectors (see Further Details).

in
lda

The leading dimension of the array A. lda>=max(1,m).

out
taua

Array of dimension (min(m,n)). The scalar factors of the elementary reflectors which represent the orthogonal matrix Q (see Further Details).

inout
B

On entry, the p-by-n matrix B. On exit, the elements on and above the diagonal of the array contain the min(p,n)-by-n upper trapezoidal matrix T (T is upper triangular if p>=n); the elements below the diagonal, with the array taub, represent the orthogonal matrix Z as a product of elementary reflectors (see Further Details).

in
ldb

The leading dimension of the array B. ldb>=max(1,p).

out
taub

Array of dimension (min(p,n)). The scalar factors of the elementary reflectors which represent the orthogonal matrix Z (see Further Details).

out
work

Array of dimension (max(1,lwork)). On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n,m,p). For optimum performance 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 a p-by-n matrix, and NB3 is the optimal blocksize for a call of SORMRQ. 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.

out
info

info=0: successful exit info<0: if info=-i, the i-th argument had an illegal value.

Functions

void dggrqf(
    const INT           m,
    const INT           p,
    const INT           n,
          f64* restrict A,
    const INT           lda,
          f64* restrict taua,
          f64* restrict B,
    const INT           ldb,
          f64* restrict taub,
          f64* restrict work,
    const INT           lwork,
          INT*          info
);
void dggrqf(const INT m, const INT p, const INT n, f64 *restrict A, const INT lda, f64 *restrict taua, f64 *restrict B, const INT ldb, f64 *restrict taub, f64 *restrict work, const INT lwork, INT *info)#

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

if M <= N,  R = ( 0  R12 ) M,   or if M > N,  R = ( R11 ) M-N,
                 N-M  M                           ( R21 ) N
                                                     N

where R12 or R21 is upper triangular, and

if P >= N,  T = ( T11 ) N  ,   or if P < N,  T = ( T11  T12 ) P,
                (  0  ) P-N                         P   N-P
                   N

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*inv(B): A*inv(B) = (R*inv(T))*Z**T where inv(B) denotes the inverse of the matrix B, and Z**T denotes the transpose of the matrix Z.

Further Details:

The matrix Q is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taua * v * v**T

where taua is a real scalar, and v is a real vector with
v[n-k+i+1:n-1] = 0 and v[n-k+i] = 1; v[0:n-k+i-1] is stored on exit in
A[m-k+i, 0:n-k+i-1], and taua in taua[i].

To form Q explicitly, use LAPACK subroutine DORGRQ. To use Q to update another matrix, use LAPACK subroutine DORMRQ.

The matrix Z is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taub * v * v**T

where taub is a real scalar, and v is a real vector with
v[0:i-1] = 0 and v[i] = 1; v[i+1:p-1] is stored on exit in
B[i+1:p-1, i], and taub in taub[i].

To form Z explicitly, use LAPACK subroutine DORGQR. To use Z to update another matrix, use LAPACK subroutine DORMQR.

Parameters

in
m

The number of rows of the matrix A. m>=0.

in
p

The number of rows of the matrix B. p>=0.

in
n

The number of columns of the matrices A and B. n>=0.

inout
A

On entry, the m-by-n matrix A. On exit, if m<=n, the upper triangle of the subarray A[0:m-1, n-m:n-1] 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 matrix Q as a product of elementary reflectors (see Further Details).

in
lda

The leading dimension of the array A. lda>=max(1,m).

out
taua

Array of dimension (min(m,n)). The scalar factors of the elementary reflectors which represent the orthogonal matrix Q (see Further Details).

inout
B

On entry, the p-by-n matrix B. On exit, the elements on and above the diagonal of the array contain the min(p,n)-by-n upper trapezoidal matrix T (T is upper triangular if p>=n); the elements below the diagonal, with the array taub, represent the orthogonal matrix Z as a product of elementary reflectors (see Further Details).

in
ldb

The leading dimension of the array B. ldb>=max(1,p).

out
taub

Array of dimension (min(p,n)). The scalar factors of the elementary reflectors which represent the orthogonal matrix Z (see Further Details).

out
work

Array of dimension (max(1,lwork)). On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n,m,p). For optimum performance 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 a p-by-n matrix, and NB3 is the optimal blocksize for a call of DORMRQ. 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.

out
info

info=0: successful exit info<0: if info=-i, the i-th argument had an illegal value.

Functions

void cggrqf(
    const INT           m,
    const INT           p,
    const INT           n,
          c64* restrict A,
    const INT           lda,
          c64* restrict taua,
          c64* restrict B,
    const INT           ldb,
          c64* restrict taub,
          c64* restrict work,
    const INT           lwork,
          INT*          info
);
void cggrqf(const INT m, const INT p, const INT n, c64 *restrict A, const INT lda, c64 *restrict taua, c64 *restrict B, const INT ldb, c64 *restrict taub, c64 *restrict work, const INT lwork, INT *info)#

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

if M <= N,  R = ( 0  R12 ) M,   or if M > N,  R = ( R11 ) M-N,
                 N-M  M                           ( R21 ) N
                                                     N

where R12 or R21 is upper triangular, and

if P >= N,  T = ( T11 ) N  ,   or if P < N,  T = ( T11  T12 ) P,
                (  0  ) P-N                         P   N-P
                   N

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*inv(B): A*inv(B) = (R*inv(T))*Z**H where inv(B) denotes the inverse of the matrix B, and Z**H denotes the conjugate transpose of the matrix Z.

Further Details:

The matrix Q is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taua * v * v**H

where taua is a complex scalar, and v is a complex vector with
v[n-k+i+1:n-1] = 0 and v[n-k+i] = 1; v[0:n-k+i-1] is stored on exit in
A[m-k+i, 0:n-k+i-1], and taua in taua[i].

To form Q explicitly, use LAPACK subroutine CUNGRQ. To use Q to update another matrix, use LAPACK subroutine CUNMRQ.

The matrix Z is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taub * v * v**H

where taub is a complex scalar, and v is a complex vector with
v[0:i-1] = 0 and v[i] = 1; v[i+1:p-1] is stored on exit in
B[i+1:p-1, i], and taub in taub[i].

To form Z explicitly, use LAPACK subroutine CUNGQR. To use Z to update another matrix, use LAPACK subroutine CUNMQR.

Parameters

in
m

The number of rows of the matrix A. m>=0.

in
p

The number of rows of the matrix B. p>=0.

in
n

The number of columns of the matrices A and B. n>=0.

inout
A

On entry, the m-by-n matrix A. On exit, if m<=n, the upper triangle of the subarray A[0:m-1, n-m:n-1] 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 unitary matrix Q as a product of elementary reflectors (see Further Details).

in
lda

The leading dimension of the array A. lda>=max(1,m).

out
taua

Array of dimension (min(m,n)). The scalar factors of the elementary reflectors which represent the unitary matrix Q (see Further Details).

inout
B

On entry, the p-by-n matrix B. On exit, the elements on and above the diagonal of the array contain the min(p,n)-by-n upper trapezoidal matrix T (T is upper triangular if p>=n); the elements below the diagonal, with the array taub, represent the unitary matrix Z as a product of elementary reflectors (see Further Details).

in
ldb

The leading dimension of the array B. ldb>=max(1,p).

out
taub

Array of dimension (min(p,n)). The scalar factors of the elementary reflectors which represent the unitary matrix Z (see Further Details).

out
work

Array of dimension (max(1,lwork)). On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n,m,p). For optimum performance 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 a p-by-n matrix, and NB3 is the optimal blocksize for a call of CUNMRQ. 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.

out
info

info=0: successful exit info<0: if info=-i, the i-th argument had an illegal value.

Functions

void zggrqf(
    const INT            m,
    const INT            p,
    const INT            n,
          c128* restrict A,
    const INT            lda,
          c128* restrict taua,
          c128* restrict B,
    const INT            ldb,
          c128* restrict taub,
          c128* restrict work,
    const INT            lwork,
          INT*           info
);
void zggrqf(const INT m, const INT p, const INT n, c128 *restrict A, const INT lda, c128 *restrict taua, c128 *restrict B, const INT ldb, c128 *restrict taub, c128 *restrict work, const INT lwork, INT *info)#

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

if M <= N,  R = ( 0  R12 ) M,   or if M > N,  R = ( R11 ) M-N,
                 N-M  M                           ( R21 ) N
                                                     N

where R12 or R21 is upper triangular, and

if P >= N,  T = ( T11 ) N  ,   or if P < N,  T = ( T11  T12 ) P,
                (  0  ) P-N                         P   N-P
                   N

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*inv(B): A*inv(B) = (R*inv(T))*Z**H where inv(B) denotes the inverse of the matrix B, and Z**H denotes the conjugate transpose of the matrix Z.

Further Details:

The matrix Q is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taua * v * v**H

where taua is a complex scalar, and v is a complex vector with
v[n-k+i+1:n-1] = 0 and v[n-k+i] = 1; v[0:n-k+i-1] is stored on exit in
A[m-k+i, 0:n-k+i-1], and taua in taua[i].

To form Q explicitly, use LAPACK subroutine ZUNGRQ. To use Q to update another matrix, use LAPACK subroutine ZUNMRQ.

The matrix Z is represented as a product of elementary reflectors

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

Each H(i) has the form

H(i) = I - taub * v * v**H

where taub is a complex scalar, and v is a complex vector with
v[0:i-1] = 0 and v[i] = 1; v[i+1:p-1] is stored on exit in
B[i+1:p-1, i], and taub in taub[i].

To form Z explicitly, use LAPACK subroutine ZUNGQR. To use Z to update another matrix, use LAPACK subroutine ZUNMQR.

Parameters

in
m

The number of rows of the matrix A. m>=0.

in
p

The number of rows of the matrix B. p>=0.

in
n

The number of columns of the matrices A and B. n>=0.

inout
A

On entry, the m-by-n matrix A. On exit, if m<=n, the upper triangle of the subarray A[0:m-1, n-m:n-1] 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 unitary matrix Q as a product of elementary reflectors (see Further Details).

in
lda

The leading dimension of the array A. lda>=max(1,m).

out
taua

Array of dimension (min(m,n)). The scalar factors of the elementary reflectors which represent the unitary matrix Q (see Further Details).

inout
B

On entry, the p-by-n matrix B. On exit, the elements on and above the diagonal of the array contain the min(p,n)-by-n upper trapezoidal matrix T (T is upper triangular if p>=n); the elements below the diagonal, with the array taub, represent the unitary matrix Z as a product of elementary reflectors (see Further Details).

in
ldb

The leading dimension of the array B. ldb>=max(1,p).

out
taub

Array of dimension (min(p,n)). The scalar factors of the elementary reflectors which represent the unitary matrix Z (see Further Details).

out
work

Array of dimension (max(1,lwork)). On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. lwork>=max(1,n,m,p). For optimum performance 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 a p-by-n matrix, and NB3 is the optimal blocksize for a call of ZUNMRQ. 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.

out
info

info=0: successful exit info<0: if info=-i, the i-th argument had an illegal value.