ggqrf#

Functions

void sggqrf(
    const INT           n,
    const INT           m,
    const INT           p,
          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 sggqrf(const INT n, const INT m, const INT p, 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)#

SGGQRF computes a generalized QR factorization of an n-by-m matrix A and an n-by-p matrix B: A = Q*R, B = Q*T*Z, 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 N >= M,  R = ( R11 ) M  ,   or if N < M,  R = ( R11  R12 ) N,
                (  0  ) N-M                         N   M-N
                   M

where R11 is upper triangular, and

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

where T12 or T21 is upper triangular.

In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of inv(B)*A: inv(B)*A = Z**T*(inv(T)*R) 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(n,m).

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[0:i-1] = 0 and v[i] = 1; v[i+1:n-1] is stored on exit in
A[i+1:n-1, i], and taua in taua[i].

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

The matrix Z is represented as a product of elementary reflectors

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

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[p-k+i+1:p-1] = 0 and v[p-k+i] = 1; v[0:p-k+i-1] is stored on exit in
B[n-k+i, 0:p-k+i-1], and taub in taub[i].

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

Parameters

in
n

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

in
m

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

in
p

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

inout
A

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

in
lda

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

out
taua

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

inout
B

On entry, the n-by-p matrix B. On exit, if n<=p, the upper triangle of the subarray B[0:n-1, p-n:p-1] contains the n-by-n upper triangular matrix T; if n>p, the elements on and above the (n-p)-th subdiagonal contain the n-by-p upper trapezoidal matrix T; the remaining elements, 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,n).

out
taub

Array of dimension (min(n,p)). 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 QR factorization of an n-by-m matrix, NB2 is the optimal blocksize for the RQ factorization of an n-by-p matrix, and NB3 is the optimal blocksize for a call of SORMQR. 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 dggqrf(
    const INT           n,
    const INT           m,
    const INT           p,
          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 dggqrf(const INT n, const INT m, const INT p, 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)#

DGGQRF computes a generalized QR factorization of an n-by-m matrix A and an n-by-p matrix B: A = Q*R, B = Q*T*Z, 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 N >= M,  R = ( R11 ) M  ,   or if N < M,  R = ( R11  R12 ) N,
                (  0  ) N-M                         N   M-N
                   M

where R11 is upper triangular, and

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

where T12 or T21 is upper triangular.

In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of inv(B)*A: inv(B)*A = Z**T*(inv(T)*R) 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(n,m).

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[0:i-1] = 0 and v[i] = 1; v[i+1:n-1] is stored on exit in
A[i+1:n-1, i], and taua in taua[i].

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

The matrix Z is represented as a product of elementary reflectors

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

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[p-k+i+1:p-1] = 0 and v[p-k+i] = 1; v[0:p-k+i-1] is stored on exit in
B[n-k+i, 0:p-k+i-1], and taub in taub[i].

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

Parameters

in
n

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

in
m

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

in
p

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

inout
A

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

in
lda

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

out
taua

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

inout
B

On entry, the n-by-p matrix B. On exit, if n<=p, the upper triangle of the subarray B[0:n-1, p-n:p-1] contains the n-by-n upper triangular matrix T; if n>p, the elements on and above the (n-p)-th subdiagonal contain the n-by-p upper trapezoidal matrix T; the remaining elements, 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,n).

out
taub

Array of dimension (min(n,p)). 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 QR factorization of an n-by-m matrix, NB2 is the optimal blocksize for the RQ factorization of an n-by-p matrix, and NB3 is the optimal blocksize for a call of DORMQR. 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 cggqrf(
    const INT           n,
    const INT           m,
    const INT           p,
          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 cggqrf(const INT n, const INT m, const INT p, 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)#

CGGQRF computes a generalized QR factorization of an n-by-m matrix A and an n-by-p matrix B: A = Q*R, B = Q*T*Z, 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 N >= M,  R = ( R11 ) M  ,   or if N < M,  R = ( R11  R12 ) N,
                (  0  ) N-M                         N   M-N
                   M

where R11 is upper triangular, and

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

where T12 or T21 is upper triangular.

In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of inv(B)*A: inv(B)*A = Z**H*(inv(T)*R) 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(n,m).

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[0:i-1] = 0 and v[i] = 1; v[i+1:n-1] is stored on exit in
A[i+1:n-1, i], and taua in taua[i].

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

The matrix Z is represented as a product of elementary reflectors

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

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[p-k+i+1:p-1] = 0 and v[p-k+i] = 1; v[0:p-k+i-1] is stored on exit in
B[n-k+i, 0:p-k+i-1], and taub in taub[i].

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

Parameters

in
n

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

in
m

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

in
p

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

inout
A

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

in
lda

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

out
taua

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

inout
B

On entry, the n-by-p matrix B. On exit, if n<=p, the upper triangle of the subarray B[0:n-1, p-n:p-1] contains the n-by-n upper triangular matrix T; if n>p, the elements on and above the (n-p)-th subdiagonal contain the n-by-p upper trapezoidal matrix T; the remaining elements, 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,n).

out
taub

Array of dimension (min(n,p)). 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 QR factorization of an n-by-m matrix, NB2 is the optimal blocksize for the RQ factorization of an n-by-p matrix, and NB3 is the optimal blocksize for a call of CUNMQR. 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 zggqrf(
    const INT            n,
    const INT            m,
    const INT            p,
          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 zggqrf(const INT n, const INT m, const INT p, 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)#

ZGGQRF computes a generalized QR factorization of an n-by-m matrix A and an n-by-p matrix B: A = Q*R, B = Q*T*Z, 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 N >= M,  R = ( R11 ) M  ,   or if N < M,  R = ( R11  R12 ) N,
                (  0  ) N-M                         N   M-N
                   M

where R11 is upper triangular, and

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

where T12 or T21 is upper triangular.

In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of inv(B)*A: inv(B)*A = Z**H*(inv(T)*R) 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(n,m).

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[0:i-1] = 0 and v[i] = 1; v[i+1:n-1] is stored on exit in
A[i+1:n-1, i], and taua in taua[i].

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

The matrix Z is represented as a product of elementary reflectors

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

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[p-k+i+1:p-1] = 0 and v[p-k+i] = 1; v[0:p-k+i-1] is stored on exit in
B[n-k+i, 0:p-k+i-1], and taub in taub[i].

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

Parameters

in
n

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

in
m

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

in
p

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

inout
A

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

in
lda

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

out
taua

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

inout
B

On entry, the n-by-p matrix B. On exit, if n<=p, the upper triangle of the subarray B[0:n-1, p-n:p-1] contains the n-by-n upper triangular matrix T; if n>p, the elements on and above the (n-p)-th subdiagonal contain the n-by-p upper trapezoidal matrix T; the remaining elements, 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,n).

out
taub

Array of dimension (min(n,p)). 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 QR factorization of an n-by-m matrix, NB2 is the optimal blocksize for the RQ factorization of an n-by-p matrix, and NB3 is the optimal blocksize for a call of ZUNMQR. 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.