QR APIs#

GEQR#

group geqr

Functions

template<typename T>
void geqr(integer *m, integer *n, T *a, integer *lda, T *t, integer *tsize, T *work, integer *lwork, integer *info)#

GEQR computes a QR factorization of M-by-N matrix.

Purpose:

  GEQR computes a QR factorization of M-by-N matrix A:

  A = Q * ( R),
          ( 0)

  where:
  Q is a M-by-M orthogonal matrix;
  R is an upper-triangular N-by-N matrix;
  0 is a (M-N)-by-N zero matrix, if M > N.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

    On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix R (R is upper triangular if M >= N); the elements below the diagonal are used to store part of the data structure to represent Q.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is array, dimension (MAX(5,TSIZE))

    On exit, if INFO = 0, T(1) returns optimal (or either minimal or optimal, if query is assumed) TSIZE. See TSIZE for details. Remaining T contains part of the data structure used to represent Q. If one wants to apply or construct Q, then one needs to keep T (in addition to A) and pass it to further subroutines.

  • TSIZE – [in]

    TSIZE is INTEGER

    If TSIZE >= 5, the dimension of the array T.

    If TSIZE = -1 or -2, then a workspace query is assumed. The routine only calculates the sizes of the T and WORK arrays, returns these values as the first entries of the T and WORK arrays, and no error message related to T or WORK is issued by XERBLA.

    If TSIZE = -1, the routine calculates optimal size of T for the optimum performance and returns this value in T(1).

    If TSIZE = -2, the routine calculates minimal size of T and returns this value in T(1).

  • WORK – [out]

    (workspace) REAL array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) contains optimal (or either minimal or optimal, if query was assumed) LWORK. See LWORK for details.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK.

    If LWORK = -1 or -2, then a workspace query is assumed. The routine only calculates the sizes of the T and WORK arrays, returns these values as the first entries of the T and WORK arrays, and no error message related to T or WORK is issued by XERBLA.

    If LWORK = -1, the routine calculates optimal size of WORK for the optimal performance and returns this value in WORK(1).

    If LWORK = -2, the routine calculates minimal size of WORK and returns this value in WORK(1).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEMQR#

group gemqr

Functions

template<typename T>
void gemqr(char *side, char *trans, integer *m, integer *n, integer *k, T *a, integer *lda, T *t, integer *tsize, T *c, integer *ldc, T *work, integer *lwork, integer *info)#

Multiples a matrix C by a real orthogonal or complex unitary matrix Q, as computed by ?geqr,

with best performance for tall and skinny matrices.

Purpose:

    GEMQR overwrites the general real M-by-N matrix C with

                   SIDE = 'L'     SIDE = 'R'
   TRANS = 'N':      Q * C          C * Q
   TRANS = 'T':      Q**T * C       C * Q**T
   where Q is a real orthogonal matrix defined as the product
   of blocked elementary reflectors computed by short wide LQ
   factorization (GEQR)

Parameters:
  • SIDE – [in]

    SIDE is CHARACTER*1

    = ‘L’: apply Q or Q**T from the Left;

    = ‘R’: apply Q or Q**T from the Right.

  • TRANS – [in]

    TRANS is CHARACTER*1

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q**T.

  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix C. N >= 0.

  • K – [in]

    K is INTEGER

    The number of elementary reflectors whose product defines the matrix Q.

    If SIDE = ‘L’, M >= K >= 0;

    if SIDE = ‘R’, N >= K >= 0.

  • A – [in]

    A is REAL array, dimension

    (LDA,M) if SIDE = ‘L’,

    (LDA,N) if SIDE = ‘R’

    Part of the data structure to represent Q as returned by DGELQ.

    @para@[in] LDA LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,K).

  • T – [in]

    T is REAL array, dimension (MAX(5,TSIZE)).

    Part of the data structure to represent Q as returned by SGELQ.

  • TSIZE – [in]

    TSIZE is INTEGER

    The dimension of the array T. TSIZE >= 5.

  • C – [inout]

    C is REAL array, dimension (LDC,N)

    On entry, the M-by-N matrix C.

    On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.

  • LDC – [in]

    LDC is INTEGER

    The leading dimension of the array C. LDC >= fla_max(1,M).

  • WORK – [out] (workspace) COMPLEX array, dimension (MAX(1,LWORK))

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK.

    If LWORK = -1, then a workspace query is assumed. The routine only calculates the size of the WORK array, returns this value as WORK(1), and no error message related to WORK is issued by XERBLA.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQRF#

group geqrf

Functions

template<typename T>
void geqrf(integer *m, integer *n, T *a, integer *lda, T *tau, T *work, integer *lwork, integer *info)#

QR factorization of a real m-by-n matrix a.

Purpose:

    QR factorization of a real m-by-n matrix a
    The factorization has the form
        A = Q * R

Parameters:
  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • a – [inout]

    a is float/double/COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the m-by-n matrix to be factored.

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

  • lda – [in]

    lda is integer*

    The leading dimension of the matrix a, lda >= fla_max(1,m)

  • tau – [out]

    tau is float/double/COMPLEX/COMPLEX*16 array, dimension (min(m,n))

    The scalar factors of the elementary reflectors (see Further Details).

    Further Details
                      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 - tau * V * V**T
    
                      where, tau is a real scalar, and V is a real vector with V(1:i-1) = 0 and V(i)
    = 1; V(i+1:M) is stored on exit in A(i+1:M,i), and tau in tau(i).
    

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQR2#

group geqr2

Functions

template<typename T>
void geqr2(integer *m, integer *n, T *a, integer *lda, T *tau, T *work, integer *info)#

QR factorization of a real m-by-n matrix a.

Purpose:

    QR factorization of a real m-by-n matrix a
    The factorization has the form
        A = Q * R

Parameters:
  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • a – [inout]

    a is float/double/COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the m-by-n matrix to be factored.

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

  • lda – [in]

    lda is integer*

    The leading dimension of the matrix a, lda >= fla_max(1,m)

  • tau – [out]

    tau is float/double/COMPLEX/COMPLEX*16 array, dimension (min(m,n))

    The scalar factors of the elementary reflectors (see Further Details).

    Further Details
                      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 - tau * V * V**T
    
                      where, tau is a real scalar, and V is a real vector with V(1:i-1) = 0 and V(i)
    = 1; V(i+1:M) is stored on exit in A(i+1:M,i), and tau in tau(i).
    

  • WORK – [out] WORK is COMPLEX array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

ORGQR#

group orgqr

Functions

template<typename T>
void orgqr(integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *work, integer *lwork, integer *info)#

Form Q from QR factorization.

Purpose:

       Generation of an m-by-n real matrix Q with orthonormal columns, which is defined as the
       first N columns of a product of K elementary reflectors of order M

       Q  =  H(1) H(2) . . . H(k)

       as returned by SGEQRF.

Parameters:
  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix Q. m >= n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.

  • a – [inout]

    a is float/double array, dimension (lda,n)

    On entry, the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by SGEQRF in the first k columns of its array argument a.

    On exit, the m-by-n matrix Q.

  • lda – [in]

    lda is integer*

    The first dimension of the array a. lda >= fla_max(1,m).

  • tau – [in]

    tau is float/double array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • WORK – [out]

    WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument has an illegal value

UNGQR#

group ungqr

Functions

template<typename T>
void ungqr(integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *work, integer *lwork, integer *info)#

Form Q from QR factorization.

Purpose:

       Generation of an m-by-n complex matrix Q with orthonormal columns, which is defined as the
       first N columns of a product of K elementary reflectors of order M

       Q  =  H(1) H(2) . . . H(k)

       as returned by SGEQRF.

Parameters:
  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix Q. m >= n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q. n >= k >= 0.

  • a – [inout]

    a is COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by CGEQRF in the first k columns of its array argument a.

    On exit, the m-by-n matrix Q.

  • lda – [in]

    lda is integer*

    The first dimension of the array a. lda >= fla_max(1,m).

  • tau – [in]

    tau is COMPLEX/COMPLEX*16 array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument has an illegal value

UNG2R#

group ung2r

Functions

template<typename T>
void org2r(integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *work, integer *info)#

ORG2R generates all or part of the orthogonal matrix Q from a QR factorization determined by sgeqrf.

Purpose:

   ORG2R generates an m by n real matrix Q with orthonormal columns,
   which is defined as the first n columns of a product of k elementary
   reflectors of order m

         Q  =  H(1) H(2) . . . H(k)

   as   returned by GEQRF.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix Q. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix Q. M >= N >= 0.

  • K – [in]

    K is INTEGER

    The number of elementary reflectors whose product defines the matrix Q. N >= K >= 0.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by SGEQRF in the first k columns of its array argument A.

    On exit, the m-by-n matrix Q.

  • LDA – [in]

    LDA is INTEGER

    The first dimension of the array A. LDA >= fla_max(1,M).

  • TAU – [in]

    TAU is REAL array, dimension (K)

    TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • WORK – [out] WORK is REAL array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument has an illegal value

template<typename T>
void ung2r(integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *work, integer *info)#

UNMQR#

group unmqr

Functions

template<typename T>
void unmqr(char *side, char *trans, integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *c, integer *ldc, T *work, integer *lwork, integer *info)#

Apply Q or Q’ from QR factorization.

Purpose:

       Apply Q or Q' from QR factorization
       Overwrite the general complex m-by-n matrix c with

       side = 'L'  side = 'R'
       trans = 'N':   Q * C C * Q
       trans = 'H':   Q**H * C C * Q**H

       where Q is a complex unitary matrix defined as the product of k elementary reflectors

       Q = H(1) H(2) . . . H(k)

       as returned by CGEQRF. Q is of order M if side = 'L' and of order N if side = 'R'.

Parameters:
  • side – [in]

    side is char*

    = ‘L’: apply Q or Q**H from the Left;

    = ‘R’: apply Q or Q**H from the Right.

  • trans – [in]

    trans is char*

    = ‘N’: No transpose, apply Q;

    = ‘H’: Transpose, apply Q**H.

  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix c. n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q.

    If side = ‘L’, m >= k >= 0;

    if side = ‘R’, n >= k >= 0.

  • a – [in]

    a is COMPLEX/COMPLEX*16 array, dimension (lda,k)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by CGEQRF in the first k columns of its array argument a.

  • lda – [in]

    lda is integer*

    The leading dimension of the array a.

    If side = ‘L’, lda >= fla_max(1,m);

    if side = ‘R’, lda >= fla_max(1,n).

  • tau – [in]

    tau is COMPLEX/COMPLEX*16 array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • c – [inout]

    c is COMPLEX/COMPLEX*16 array, dimension (ldc,n)

    On entry, the m-by-n matrix c.

    On exit, c is overwritten by Q*C or Q**H*C or C*Q**H or C*Q.

  • ldc – [in]

    ldc is integer*

    The leading dimension of the array c. ldc >= fla_max(1,m).

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK.

    If SIDE = ‘L’, LWORK >= fla_max(1,N);

    if SIDE = ‘R’, LWORK >= fla_max(1,M).

    For good performance, LWORK should generally be larger.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

ORMQR#

group ormqr

Functions

template<typename T>
void ormqr(char *side, char *trans, integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *c, integer *ldc, T *work, integer *lwork, integer *info)#

Apply Q or Q’ from QR factorization.

Purpose:

       Apply Q or Q' from QR factorization
       Overwrite the general real m-by-n matrix c with

       side = 'L'  side = 'R'
       trans = 'N':   Q * C C * Q
       trans = 'T':   Q**T * C C * Q**T

       where Q is a real orthogonal matrix defined as the product of k elementary reflectors

       Q = H(1) H(2) . . . H(k)

       as returned by SGEQRF. Q is of order M if side = 'L' and of order N if side = 'R'.

Parameters:
  • side – [in]

    side is char*

    = ‘L’: apply Q or Q**T from the Left;

    = ‘R’: apply Q or Q**T from the Right.

  • trans – [in]

    trans is char*

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q**T.

  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix c. n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q.

    If side = ‘L’, m >= k >= 0;

    if side = ‘R’, n >= k >= 0.

  • a – [in]

    a is float/double array, dimension (lda,k)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by SGEQRF in the first k columns of its array argument a.

  • lda – [in]

    lda is integer*

    The leading dimension of the array a.

    If side = ‘L’, lda >= fla_max(1,m);

    if side = ‘R’, lda >= fla_max(1,n).

  • tau – [in]

    tau is float/double array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • c – [inout]

    c is float/double array, dimension (ldc,n)

    On entry, the m-by-n matrix c.

    On exit, c is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.

  • ldc – [in]

    ldc is integer*

    The leading dimension of the array c. ldc >= fla_max(1,m).

  • WORK – [out]

    WORK is REAL array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK.

    If SIDE = ‘L’, LWORK >= fla_max(1,N);

    if SIDE = ‘R’, LWORK >= fla_max(1,M).

    For good performance, LWORK should generally be larger.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

ORM2R#

group orm2r

Functions

template<typename T>
void orm2r(char *side, char *trans, integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *c, integer *ldc, T *work, integer *info)#

Multiply a general matrix by the orthogonal matrix from a QR factorization determined by sgeqrf (unblocked algorithm).

Purpose:

    Multiply a general matrix by the orthogonal matrix from a QR factorization determined by
    sgeqrf (unblocked algorithm).
    Overwrite the general real m by n matrix c with

    Q * C  if side = 'L' and trans = 'N', or

    Q**T* C  if side = 'L' and trans = 'T', or

    C * Q  if side = 'R' and trans = 'N', or

    C * Q**T if side = 'R' and trans = 'T',

    where Q is a real orthogonal matrix defined as the product of k elementary reflectors

    Q = H(1) H(2) . . . H(k)

    as returned by SGEQRF. Q is of order m if side = 'L' and of order n if side = 'R'.

Parameters:
  • side – [in]

    side is char*

    = ‘L’: apply Q or Q**T from the Left;

    = ‘R’: apply Q or Q**T from the Right.

  • trans – [in]

    trans is char*

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q**T.

  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix c. n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q.

    If side = ‘L’, m >= k >= 0;

    if side = ‘R’, n >= k >= 0.

  • a – [in]

    a is float/double array, dimension (lda,k)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by SGEQRF in the first k columns of its array argument a.

  • lda – [in]

    lda is integer*

    The leading dimension of the array a.

    If side = ‘L’, lda >= fla_max(1,m);

    if side = ‘R’, lda >= fla_max(1,n).

  • tau – [in]

    tau is float/double array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by SGEQRF.

  • c – [inout]

    c is float/double array, dimension (ldc,n)

    On entry, the m-by-n matrix c.

    On exit, c is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.

  • ldc – [in]

    ldc is integer*

    The leading dimension of the array c. ldc >= fla_max(1,m).

  • WORK – [out]

    WORK is REAL array, dimension

    (N) if SIDE = ‘L’,

    (M) if SIDE = ‘R’

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

UNM2R#

group unm2r

Functions

template<typename T>
void unm2r(char *side, char *trans, integer *m, integer *n, integer *k, T *a, integer *lda, T *tau, T *c, integer *ldc, T *work, integer *info)#

Multiply a general matrix by the orthogonal matrix from a QR factorization determined by sgeqrf (unblocked algorithm).

Purpose:

    Multiply a general matrix by the orthogonal matrix from a QR factorization determined by
    sgeqrf (unblocked algorithm).
    Overwrite the general complex m by n matrix c with

    Q * C  if side = 'L' and trans = 'N', or

    Q**H* C  if side = 'L' and trans = 'C', or

    C * Q  if side = 'R' and trans = 'N', or

    C * Q**H if side = 'R' and trans = 'C',

    where Q is a complex unitary matrix defined as the product of k elementary reflectors

    Q = H(1) H(2) . . . H(k)

    as returned by SGEQRF. Q is of order m if side = 'L' and of order n if side = 'R'.

Parameters:
  • side – [in]

    side is char*

    = ‘L’: apply Q or Q**H from the Left;

    = ‘R’: apply Q or Q**H from the Right.

  • trans – [in]

    trans is char*

    = ‘N’: No transpose, apply Q;

    = ‘C’: Transpose, apply Q**H.

  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix c. n >= 0.

  • k – [in]

    k is integer*

    The number of elementary reflectors whose product defines the matrix Q.

    If side = ‘L’, m >= k >= 0;

    if side = ‘R’, n >= k >= 0.

  • a – [in]

    a is COMPLEX/COMPLEX*16 array, dimension (lda,k)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by CGEQRF in the first k columns of its array argument a.

  • lda – [in]

    lda is integer*

    The leading dimension of the array a.

    If side = ‘L’, lda >= fla_max(1,m);

    if side = ‘R’, lda >= fla_max(1,n).

  • tau – [in]

    tau is COMPLEX/COMPLEX*16 array, dimension (k)

    tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by CGEQRF.

  • c – [inout]

    c is COMPLEX/COMPLEX*16 array, dimension (ldc,n)

    On entry, the m-by-n matrix c.

    On exit, c is overwritten by Q*C or Q**H*C or C*Q**H or C*Q.

  • ldc – [in]

    ldc is integer*

    The leading dimension of the array c. ldc >= fla_max(1,m).

  • WORK – [out]

    WORK is COMPLEX array, dimension

    (N) if SIDE = ‘L’,

    (M) if SIDE = ‘R’

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQRT#

group geqrt

Functions

template<typename T>
void geqrt(integer *m, integer *n, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *work, integer *info)#

GEQRT computes a blocked QR factorization of a M-by-N matrix A

using the compact WY representation.

Purpose:

  GEQRT computes a blocked QR factorization of a M-by-N matrix A
  using the compact WY representation of Q.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • NB – [in]

    NB is INTEGER

    The block size to be used in the blocked QR. MIN(M,N) >= NB >= 1.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

    On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix R (R is upper triangular if M >= N); the elements below the diagonal are the columns of V.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT,MIN(M,N))

    The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See below for further details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • WORK – [out] WORK is COMPLEX array, dimension (NB*N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQRT2#

group geqrt2

Functions

template<typename T>
void geqrt2(integer *m, integer *n, T *a, integer *lda, T *t, integer *ldt, integer *info)#

GEQRT2 computes a blocked QR factorization of a M-by-N matrix A

using the compact WY representation.

Purpose:

  GEQRT2 computes a QR factorization of a real M-by-N matrix A,
  using the compact WY representation of Q.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= N.

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the real M-by-N matrix A. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrix R; the elements below the diagonal are the columns of V. See below for further details.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT,N)

    The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflector T; the elements below the diagonal are not used. See below for further details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQRT3#

group geqrt3

Functions

template<typename T>
void geqrt3(integer *m, integer *n, T *a, integer *lda, T *t, integer *ldt, integer *info)#

GEQRT3 computes a blocked QR factorization of a M-by-N matrix A

using the compact WY representation.

Purpose:

  GEQRT3 computes a QR factorization of a real M-by-N matrix A,
  using the compact WY representation of Q.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= N.

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the real M-by-N matrix A. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrix R; the elements below the diagonal are the columns of V. See below for further details.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT,N)

    The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflector T; the elements below the diagonal are not used. See below for further details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEMQRT#

group gemqrt

Functions

template<typename T>
void gemqrt(char *side, char *trans, integer *m, integer *n, integer *k, integer *nb, T *v, integer *ldv, T *t, integer *ldt, T *c, integer *ldc, T *work, integer *info)#

Multiplies a general matrix by the orthogonal/unitary matrix Q of the QR factorization formed by ?geqrt.

Purpose:

     GEMQRT overwrites the general real M-by-N matrix C with

                    SIDE = 'L'     SIDE = 'R'
     TRANS = 'N':      Q C            C Q
     TRANS = 'T':   Q**T C            C Q**T

     where Q is a real orthogonal matrix defined as the product of K
     elementary reflectors:

          Q = H(1) H(2) . . . H(K) = I - V T V**T

     generated using the compact WY representation as returned by SGEQRT.

     Q is of order M if SIDE = 'L' and of order N  if SIDE = 'R'.

Parameters:
  • SIDE – [in]

    SIDE is CHARACTER*1

    = ‘L’: apply Q or Q**T from the Left;

    = ‘R’: apply Q or Q**T from the Right.

  • TRANS – [in]

    TRANS is CHARACTER*1

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q**T.

  • M – [in]

    M is INTEGER

    The number of rows of the matrix C. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix C. N >= 0.

  • K – [in]

    K is INTEGER

    The number of elementary reflectors whose product defines the matrix Q.

    If SIDE = ‘L’, M >= K >= 0;

    if SIDE = ‘R’, N >= K >= 0.

  • NB – [in]

    NB is INTEGER

    The block size used for the storage of T. K >= NB >= 1.

    This must be the same value of NB used to generate T in CGEQRT.

  • V – [in]

    V is REAL array, dimension (LDV,K)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by CGEQRT in the first K columns of its array argument A.

  • LDV – [in]

    LDV is INTEGER

    The leading dimension of the array V.

    If SIDE = ‘L’, L/*!DA >= fla_max(1,M);

    if SIDE = ‘R’, LDA >= fla_max(1,N).

  • T – [in]

    T is REAL array, dimension (LDT,K)

    The upper triangular factors of the block reflectors as returned by CGEQRT, stored as a NB-by-N matrix.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • C – [inout]

    C is REAL array, dimension (LDC,N)

    On entry, the M-by-N matrix C.

    On exit, C is overwritten by Q C, Q**T C, C Q**T or C Q.

  • LDC – [in]

    LDC is INTEGER

    The leading dimension of the array C. LDC >= fla_max(1,M).

  • WORK – [out] WORK is COMPLEX array. The dimension of WORK is N*NB if SIDE = ‘L’, or M*NB if SIDE = ‘R’.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQRFP#

group geqrfp

Functions

template<typename T>
void geqrfp(integer *m, integer *n, T *a, integer *lda, T *tau, T *work, integer *lwork, integer *info)#

GEQRP computes a QR factorization of a M-by-N matrix.

Purpose:

    GEQRP computes a QR factorization of a M-by-N matrix A:
       A = Q * ( R),
               ( 0)

    where:
       Q is a M-by-M orthogonal matrix;
       R is an upper-triangular N-by-N matrix with nonnegative diagonal
       entries;
       0 is a (M-N)-by-N zero matrix, if M > N.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

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

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • TAU – [out]

    TAU is array, dimension (min(M,N))

    The scalar factors of the elementary reflectors (see Further Details).

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQR2P#

group geqr2p

Functions

template<typename T>
void geqr2p(integer *m, integer *n, T *a, integer *lda, T *tau, T *work, integer *info)#

GEQR2P computes the QR factorization of a general rectangular

matrix with non-negative diagonal elements using an unblocked algorithm.

Purpose:

 GEQR2P computes a QR factorization of a real m-by-n matrix A:

    A = Q * (R),
            (0)

 where:

    Q is a m-by-m orthogonal matrix;
    R is an upper-triangular n-by-n matrix with nonnegative diagonal
    entries;
    0 is a (m-n)-by-n zero matrix, if m > n.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the m by n matrix A.

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

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • TAU – [out]

    TAU is REAL array, dimension (min(M,N))

    The scalar factors of the elementary reflectors (see Further Details).

  • WORK – [out] WORK is REAL array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GEQP3#

group geqp3

Functions

template<typename T>
void geqp3(integer *m, integer *n, T *a, integer *lda, integer *jpvt, T *tau, T *work, integer *lwork, integer *info)#

QR factorization of a real m-by-n matrix a.

Purpose:

       QR factorization with column pivoting of a real m-by-n matrix a:
           A*P = Q*R
       using Level 3 BLAS.

Further Details

                     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 - tau * V * V**T

                     where tau is a real scalar, and V is a real/complex vector with V(1:i-1) = 0
and V(i) = 1; V(i+1:M) is stored on exit in A(i+1:M,i), and tau in tau(i)

Parameters:
  • m – [in]

    m is integer*

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

  • n – [in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • a – [inout]

    a is float/double array, dimension (lda,n)

    On entry, the m-by-n matrix a.

    On exit, the upper triangle of the array contains the min(m,n)-by-n upper triangular matrix R; the elements below the diagonal, together with the array tau, represent the orthogonal matrix Q as a product of min(m,n) elementary reflectors.

  • lda – [in]

    lda is integer*

    The leading dimension of the matrix a, lda >= fla_max(1,m)

  • jpvt – [inout]

    jpvt is integer array, dimension (n)

    On entry, if jpvt(J).ne.0, the J-th column of A is permuted to the front of A*P (a leading column); if jpvt(J) = 0, the J-th column of A is a free column.

    On exit, if jpvt(J) = K, then the J-th column of A*P was the K-th column of A.

  • tau – [out]

    tau is float/double array, dimension (min(m,n))

    The scalar factors of the elementary reflectors.

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO=0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= N+1. For optimal performance LWORK >= ( N+1 )*NB, where NB is the optimal blocksize.

    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.

  • RWORK – [out] RWORK is REAL array, dimension (2*N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit.

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

template<typename T, typename Ta>
void geqp3(integer *m, integer *n, T *a, integer *lda, integer *jpvt, T *tau, T *work, integer *lwork, Ta *rwork, integer *info)#

LAQP2#

group laqp2

Functions

template<typename T>
void laqp2(integer *m, integer *n, integer *offset, T *a, integer *lda, integer *jpvt, T *tau, T *vn1, T *vn2, T *work)#

LAQP2 computes a QR factorization with column pivoting of the matrix block.

Purpose:

 LAQP2 computes a QR factorization with column pivoting of
 the block A(OFFSET+1:M,1:N).
 The block A(1:OFFSET,1:N) is accordingly pivoted, but not factorized.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • OFFSET – [in]

    OFFSET is INTEGER

    The number of rows of the matrix A that must be pivoted but no factorized. OFFSET >= 0.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

    On exit, the upper triangle of block A(OFFSET+1:M,1:N) is the triangular factor obtained; the elements in block A(OFFSET+1:M,1:N) below the diagonal, together with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. Block A(1:OFFSET,1:N) has been accordingly pivoted, but no factorized.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • JPVT – [inout]

    JPVT is INTEGER array, dimension (N)

    On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted to the front of A*P (a leading column); if JPVT(i) = 0, the i-th column of A is a free column.

    On exit, if JPVT(i) = k, then the i-th column of A*P was the k-th column of A.

  • TAU – [out]

    TAU is REAL array, dimension (min(M,N))

    The scalar factors of the elementary reflectors.

  • VN1 – [inout]

    VN1 is REAL array, dimension (N)

    The vector with the partial column norms.

  • VN2 – [inout]

    VN2 is REAL array, dimension (N)

    The vector with the exact column norms.

  • WORK – [out] WORK is REAL array, dimension (N)

template<typename T, typename Ta>
void laqp2(integer *m, integer *n, integer *offset, T *a, integer *lda, integer *jpvt, T *tau, Ta *vn1, Ta *vn2, T *work)#

LAQPS#

group laqps

Functions

template<typename T>
void laqps(integer *m, integer *n, integer *offset, integer *nb, integer *kb, T *a, integer *lda, integer *jpvt, T *tau, T *vn1, T *vn2, T *auxv, T *f, integer *ldf)#

LAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BLAS level 3.

Purpose:

   LAQPS computes a step of QR factorization with column pivoting
   of a real M-by-N matrix A by using Blas-3.  It tries to factorize
   NB columns from A starting from the row OFFSET+1, and updates all
   of the matrix with Blas-3 xGEMM.

   In some cases, due to catastrophic cancellations, it cannot
   factorize NB columns.  Hence, the actual number of factorized
   columns is   returned in KB.

   Block A(1:OFFSET,1:N) is accordingly pivoted, but not factorized.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • OFFSET – [in]

    OFFSET is INTEGER

    The number of rows of A that have been factorized in previous steps.

  • NB – [in]

    NB is INTEGER

    The number of columns to factorize.

  • KB – [out]

    KB is INTEGER

    The number of columns actually factorized.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

    On exit, block A(OFFSET+1:M,1:KB) is the triangular factor obtained and block A(1:OFFSET,1:N) has been accordingly pivoted, but no factorized. The rest of the matrix, block A(OFFSET+1:M,KB+1:N) has been updated.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • JPVT – [inout]

    JPVT is INTEGER array, dimension (N)

    JPVT(I) = K <==> Column K of the full matrix A has been permuted into position I in AP.

  • TAU – [out]

    TAU is REAL array, dimension (KB)

    The scalar factors of the elementary reflectors.

  • VN1 – [inout]

    VN1 is REAL array, dimension (N)

    The vector with the partial column norms.

  • VN2 – [inout]

    VN2 is REAL array, dimension (N)

    The vector with the exact column norms.

  • AUXV – [inout]

    AUXV is REAL array, dimension (NB)

    Auxiliary vector.

  • F – [inout]

    F is REAL array, dimension (LDF,NB)

    Matrix F**T = L*Y**T*A.

  • LDF – [in]

    LDF is INTEGER

    The leading dimension of the array F. LDF >= fla_max(1,N).

template<typename T, typename Ta>
void laqps(integer *m, integer *n, integer *offset, integer *nb, integer *kb, T *a, integer *lda, integer *jpvt, T *tau, Ta *vn1, Ta *vn2, T *auxv, T *f, integer *ldf)#

LATSQR#

group latsqr

Functions

template<typename T>
void latsqr(integer *m, integer *n, integer *mb, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *work, integer *lwork, integer *info)#

LATSQR computes a blocked Tall-Skinny QR factorization of a real M-by-N matrix A for M >= N.

Purpose:

   LATSQR computes a blocked Tall-Skinny QR factorization of
   a real M-by-N matrix A for M >= N:

      A = Q * (R),
              (0)

   where:

      Q is a M-by-M orthogonal matrix, stored on exit in an implicit
      form in the elements below the digonal of the array A and in
      the elemenst of the array T;

      R is an upper-triangular N-by-N matrix, stored on exit in
      the elements on and above the diagonal of the array A.

      0 is a (M-N)-by-N zero matrix, and is not stored.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. M >= N >= 0.

  • MB – [in]

    MB is INTEGER

    The row block size to be used in the blocked QR. MB > N.

  • NB – [in]

    NB is INTEGER

    The column block size to be used in the blocked QR. N >= NB >= 1.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix A.

    On exit, the elements on and above the diagonal of the array contain the N-by-N upper triangular matrix R; the elements below the diagonal represent Q by the columns of blocked V (see Further Details).

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT, N * Number_of_row_blocks)

    where Number_of_row_blocks = CEIL((M-N)/(MB-N))

    The blocked upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See Further Details below.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • WORK – [out] (workspace) REAL array, dimension (MAX(1,LWORK))

  • LWORK – [in]

    The dimension of the array WORK. LWORK >= NB*N.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

ORGTSQR#

group orgtsqr

Functions

template<typename T>
void orgtsqr(integer *m, integer *n, integer *mb, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *work, integer *lwork, integer *info)#

ORGTSQR generates an M-by-N real matrix Q_out with orthonormal columns.

Purpose:

  ORGTSQR generates an M-by-N real matrix Q_out with orthonormal columns,
  which are the first N columns of a product of real orthogonal
  matrices of order M which are   returned by SLATSQR

       Q_out = first_N_columns_of(Q(1)_in * Q(2)_in * ... * Q(k)_in).

  See the documentation for LATSQR.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. M >= N >= 0.

  • MB – [in]

    MB is INTEGER

    The row block size used by SLATSQR to return arrays A and T. MB > N.

    (Note that if MB > M, then M is used instead of MB as the row block size).

  • NB – [in]

    NB is INTEGER

    The column block size used by SLATSQR to return arrays A and T. NB >= 1.

    (Note that if NB > N, then N is used instead of NB as the column block size).

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry:

    The elements on and above the diagonal are not accessed. The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by SLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored) (same format as the output A below the diagonal in SLATSQR).

    On exit:

    The array A contains an M-by-N orthonormal matrix Q_out, i.e the columns of A are orthogonal unit vectors.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [in]

    T is REAL array, dimension (LDT, N * NIRB)

    where NIRB = Number_of_input_row_blocks

    = MAX(1, CEIL((M-N)/(MB-N)))

    Let NICB = Number_of_input_col_blocks

    = CEIL(N/NB)

    The upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). The block reflectors are stored in compact form in NIRB block reflector sequences. Each of NIRB block reflector sequences is stored in a larger NB-by-N column block of T and consists of NICB smaller NB-by-NB upper-triangular column blocks. (same format as the output T in SLATSQR).

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,min(NB1,N)).

  • WORK – [out]

    (workspace) REAL array, dimension (MAX(2,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    The dimension of the array WORK. LWORK >= (M+NB)*N.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T>
void ungtsqr(integer *m, integer *n, integer *mb, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *work, integer *lwork, integer *info)#

ORGTSQR_ROW#

group orgtqr_

Functions

template<typename T>
void gtsqr_row(integer *m, integer *n, integer *mb, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *work, integer *lwork, integer *info)#

ORGTSQR_ROW generates an M-by-N real matrix Q_out with orthonormal columns from the output of LATSQR.

Purpose:

   ORGTSQR_ROW generates an M-by-N real matrix Q_out with
   orthonormal columns from the output of LATSQR. These N orthonormal
   columns are the first N columns of a product of complex unitary
   matrices Q(k)_in of order M, which are returned by SLATSQR in
   a special format.

       Q_out = first_N_columns_of( Q(1)_in * Q(2)_in * ... * Q(k)_in ).

   The input matrices Q(k)_in are stored in row and column blocks in A.
   See the documentation of SLATSQR for more details on the format of
   Q(k)_in, where each Q(k)_in is represented by block Householder
   transformations. This routine calls an auxiliary routine SLARFB_GETT,
   where the computation is performed on each individual block. The
   algorithm first sweeps NB-sized column blocks from the right to left
   starting in the bottom row block and continues to the top row block
   (hence _ROW in the routine name). This sweep is in reverse order of
   the order in which SLATSQR generates the output blocks.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. M >= N >= 0.

  • MB – [in]

    MB is INTEGER

    The row block size used by SLATSQR to return arrays A and T. MB > N. (Note that if MB > M, then M is used instead of MB as the row block size).

  • NB – [in]

    NB is INTEGER

    The column block size used by SLATSQR to return arrays A and T. NB >= 1.

    (Note that if NB > N, then N is used instead of NB as the column block size).

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry:

    The elements on and above the diagonal are not used as input. The elements below the diagonal represent the unit lower-trapezoidal blocked matrix V computed by SLATSQR that defines the input matrices Q_in(k) (ones on the diagonal are not stored). See SLATSQR for more details.

    On exit:

    The array A contains an M-by-N orthonormal matrix Q_out, i.e the columns of A are orthogonal unit vectors.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [in]

    T is REAL array, dimension (LDT, N * NIRB)

    where NIRB = Number_of_input_row_blocks = MAX( 1, CEIL((M-N)/(MB-N)) )

    Let NICB = Number_of_input_col_blocks

    = CEIL(N/NB)

    The upper-triangular block reflectors used to define the input matrices Q_in(k), k=(1:NIRB*NICB). The block reflectors are stored in compact form in NIRB block reflector sequences. Each of the NIRB block reflector sequences is stored in a larger NB-by-N column block of T and consists of NICB smaller NB-by-NB upper-triangular column blocks. See SLATSQR for more details on the format of T.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,min(NB,N)).

  • WORK – [out]

    (workspace) REAL array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    The dimension of the array WORK.

    LWORK >= NBLOCAL * MAX(NBLOCAL,(N-NBLOCAL)), where NBLOCAL=MIN(NB,N).

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

LARFB_GETT#

group larfb_

Functions

template<typename T>
void larfb_gett(char *ident, integer *m, integer *n, integer *k, T *t, integer *ldt, T *a, integer *lda, T *b, integer *ldb, T *work, integer *ldwork)#

LARFB_GETT applies a real Householder block reflector H from the left to a real (K+M)-by-N “triangular-pentagonal” matrix.

Purpose:

   LARFB_GETT applies a real Householder block reflector H from the
   left to a real (K+M)-by-N  "triangular-pentagonal" matrix
   composed of two block matrices: an upper trapezoidal K-by-N matrix A
   stored in the array A, and a rectangular M-by-(N-K) matrix B, stored
   in the array B. The block reflector H is stored in a compact
   WY-representation, where the elementary reflectors are in the
   arrays A, B and T. See Further Details section.

Parameters:
  • IDENT – [in]

    IDENT is CHARACTER*1

    If IDENT = not ‘I’, or not ‘i’, then V1 is unit lower-triangular and stored in the left K-by-K block of the input matrix A,

    If IDENT = ‘I’ or ‘i’, then V1 is an identity matrix and not stored.

    See Further Details section.

  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • K – [in]

    K is INTEGER

    The number or rows of the matrix A.

    K is also order of the matrix T, i.e. the number of elementary reflectors whose product defines the block reflector. 0 <= K <= N.

  • T – [in]

    T is REAL array, dimension (LDT,K)

    The upper-triangular K-by-K matrix T in the representation of the block reflector.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= K.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry:

    a) In the K-by-N upper-trapezoidal part A: input matrix A.

    b) In the columns below the diagonal: columns of V1 (ones are not stored on the diagonal).

    On exit:

    A is overwritten by rectangular K-by-N product H*A.

    See Further Details section.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,K).

  • B – [inout]

    B is REAL array, dimension (LDB,N)

    On entry:

    a) In the M-by-(N-K) right block: input matrix B.

    b) In the M-by-N left block: columns of V2.

    On exit:

    B is overwritten by rectangular M-by-N product H*B.

    See Further Details section.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

  • WORK – [out]

    WORK is REAL array,

    dimension (LDWORK,max(K,N-K))

  • LDWORK – [in]

    LDWORK is INTEGER

    The leading dimension of the array WORK. LDWORK>=max(1,K).

LAMTSQR#

group lamtsqr

Functions

template<typename T>
void lamtsqr(char *side, char *trans, integer *m, integer *n, integer *k, integer *mb, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *c, integer *ldc, T *work, integer *lwork, integer *info)#

LAMTSQR overwrites the general real M-by-N matrix C.

Purpose:

   LAMTSQR overwrites the general real M-by-N matrix C with

                  SIDE = 'L'     SIDE = 'R'
  TRANS = 'N':      Q * C          C * Q
  TRANS = 'T':      Q**T * C       C * Q**T
  where Q is a real orthogonal matrix defined as the product
  of blocked elementary reflectors computed by tall skinny
  QR factorization (DLATSQR)

Parameters:
  • SIDE – [in]

    SIDE is CHARACTER*1

    = ‘L’: apply Q or Q**T from the Left;

    = ‘R’: apply Q or Q**T from the Right.

  • TRANS – [in]

    TRANS is CHARACTER*1

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q**T.

  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix C. M >= N >= 0.

  • K – [in]

    K is INTEGER

    The number of elementary reflectors whose product defines the matrix Q. N >= K >= 0;

  • MB – [in]

    MB is INTEGER

    The block size to be used in the blocked QR. MB > N. (must be the same as DLATSQR)

  • NB – [in]

    NB is INTEGER

    The column block size to be used in the blocked QR. N >= NB >= 1.

  • A – [in]

    A is REAL array, dimension (LDA,K)

    The i-th column must contain the vector which defines the blockedelementary reflector H(i), for i = 1,2,…,k, as returned by DLATSQR in the first k columns of its array argument A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A.

    If SIDE = ‘L’, LDA >= fla_max(1,M);

    if SIDE = ‘R’, LDA >= fla_max(1,N).

  • T – [in]

    T is REAL array, dimension

    (N * Number of blocks(CEIL(M-K/MB-K)),

    The blocked upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See below for further details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • C – [inout]

    C is REAL array, dimension (LDC,N)

    On entry, the M-by-N matrix C. On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.

  • LDC – [in]

    LDC is INTEGER

    The leading dimension of the array C. LDC >= fla_max(1,M).

  • WORK – [out] (workspace) REAL array, dimension (MAX(1,LWORK))

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK.

    If SIDE = ‘L’, LWORK >= fla_max(1,N)*NB;

    if SIDE = ‘R’, LWORK >= fla_max(1,MB)*NB.

    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.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GETSQRHRT#

group getsqrhrt

Functions

template<typename T>
void getsqrhrt(integer *m, integer *n, integer *mb1, integer *nb1, integer *nb2, T *a, integer *lda, T *t, integer *ldt, T *work, integer *lwork, integer *info)#

Computes a NB2-sized column blocked QR-factorization.

Purpose:

 The routine computes a NB2-sized column blocked QR-factorization of a
 complex M-by-N matrix A with M >= N,

 A = Q * R.

 The routine uses internally a NB1-sized column blocked and MB1-sized
 row blocked TSQR-factorization and perfors the reconstruction
 of the Householder vectors from the TSQR output. The routine also
 converts the R_tsqr factor from the TSQR-factorization output into
 the R factor that corresponds to the Householder QR-factorization,

   A = Q_tsqr * R_tsqr = Q * R.

 The output Q and R factors are stored in the same format as in CGEQRT
 (Q is in blocked compact WY-representation). See the documentation
 of CGEQRT for more details on the format.

Parameters:
  • m – [in]

    M is INTEGER

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

  • n – [in]

    N is INTEGER

    The number of columns of the matrix A. M >= N >= 0.

  • mb1 – [in]

    MB1 is INTEGER

    The row block size to be used in the blocked TSQR.

    MB1 > N.

  • nb1 – [inout]

    NB1 is INTEGER

    The column block size to be used in the blocked TSQR.

    N >= NB1 >= 1.

  • nb2 – [inout]

    NB2 is INTEGER

    The block size to be used in the blocked QR that is

    output. NB2 >= 1.

  • a – [inout]

    A is REAL/DOUBLE/COMPLEX/COMPLEX*16 array, dimension (LDA,N)

    On entry: an M-by-N matrix A.

    On exit:

    a) the elements on and above the diagonal of the array contain the N-by-N upper-triangular matrix R corresponding to the Householder QR;

    b) the elements below the diagonal represent Q by the columns of blocked V (compact WY-representation).

  • lda – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • t – [inout]

    T is REAL/DOUBLE/COMPLEX/COMPLEX*16 array, dimension (LDT,N))

    The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks.

  • ldt – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB2.

  • work – [out]

    WORK is REAL/DOUBLE/COMPLEX/COMPLEX*16 array, dimension (N,NRHS)

    This array is used to hold the residual vectors.

  • lwork – [out]

    The dimension of the array WORK.

    LWORK >= MAX( LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ),

    where

    NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)),

    NB1LOCAL = MIN(NB1,N).

    LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL,

    LW1 = NB1LOCAL * N,

    LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ),

    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.

  • info – [in]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

ORHR_COL#

group orhr_col

Functions

template<typename T>
void orhr_col(integer *m, integer *n, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *d, integer *info)#

ORHR_COL takes an M-by-N real matrix Q_in with orthonormal columns

as input and performs Householder Reconstruction.

Purpose:

  ORHR_COL takes an M-by-N real matrix Q_in with orthonormal columns
  as input, stored in A, and performs Householder Reconstruction (HR),
  i.e. reconstructs Householder vectors V(i) implicitly representing
  another M-by-N matrix Q_out, with the property that Q_in = Q_out*S,
  where S is an N-by-N diagonal matrix with diagonal entries
  equal to +1 or -1. The Householder vectors (columns V(i) of V) are
  stored in A on output, and the diagonal entries of S are stored in D.
  Block reflectors are also   returned in T
  (same output format as SGEQRT).

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. M >= N >= 0.

  • NB – [in]

    NB is INTEGER

    The column block size to be used in the reconstruction of Householder column vector blocks in the array A and corresponding block reflectors in the array T. NB >= 1. (Note that if NB > N, then N is used instead of NB as the column block size.)

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry:

    The array A contains an M-by-N orthonormal matrix Q_in, i.e the columns of A are orthogonal unit vectors.

    On exit:

    The elements below the diagonal of A represent the unit lower-trapezoidal matrix V of Householder column vectors V(i). The unit diagonal entries of V are not stored (same format as the output below the diagonal in A from SGEQRT). The matrix T and the matrix V stored on output in A implicitly define Q_out.

    The elements above the diagonal contain the factor U of the “modified” LU-decomposition:

    Q_in - (S) = V * U

    (0)

    where 0 is a (M-N)-by-(M-N) zero matrix.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT, N)

    Let NOCB = Number_of_output_col_blocks

    = CEIL(N/NB)

    On exit, T(1:NB, 1:N) contains NOCB upper-triangular block reflectors used to define Q_out stored in compact form as a sequence of upper-triangular NB-by-NB column blocks (same format as the output T in SGEQRT). The matrix T and the matrix V stored on output in A implicitly define Q_out. NOTE: The lower triangles below the upper-triangular blcoks will be filled with zeros. See Further Details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,min(NB,N)).

  • D – [out]

    D is REAL array, dimension min(M,N).

    The elements can be only plus or minus one.

    D(i) is constructed as D(i) = -SIGN(Q_in_i(i,i)), where 1 <= i <= min(M,N), and Q_in_i is Q_in after performing i-1 steps of “modified” Gaussian elimination. See Further Details.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T>
void unhr_col(integer *m, integer *n, integer *nb, T *a, integer *lda, T *t, integer *ldt, T *d, integer *info)#

LAUNHR_COL_GETRFNP#

group launhr_col_getrfnp

Functions

template<typename T>
void launhr_col_getrfnp(integer *m, integer *n, T *a, integer *lda, T *d, integer *info)#

LAUNHR_COL_GETRFNP computes the modified LU factorization without pivoting of a complex general M-by-N matrix A.

Purpose:

   LAUNHR_COL_GETRFNP computes the modified LU factorization without
   pivoting of a complex general M-by-N matrix A. The factorization has
   the form:

       A - S = L * U,

   where:
      S is a m-by-n diagonal sign matrix with the diagonal D, so that
      D(i) = S(i,i), 1 <= i <= min(M,N). The diagonal D is constructed
      as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing
      i-1 steps of Gaussian elimination. This means that the diagonal
      element at each step of "modified" Gaussian elimination is
      at least one in absolute value (so that division-by-zero not
      not possible during the division by the diagonal element);

      L is a M-by-N lower triangular matrix with unit diagonal elements
      (lower trapezoidal if M > N);

      and U is a M-by-N upper triangular matrix
      (upper trapezoidal if M < N).

   This routine is an auxiliary routine used in the Householder
   reconstruction routine CUNHR_COL. In CUNHR_COL, this routine is
   applied to an M-by-N matrix A with orthonormal columns, where each
   element is bounded by one in absolute value. With the choice of
   the matrix S above, one can show that the diagonal element at each
   step of Gaussian elimination is the largest (in absolute value) in
   the column on or below the diagonal, so that no pivoting is required
   for numerical stability [1].

   For more details on the Householder reconstruction algorithm,
   including the modified LU factorization, see [1].

   This is the blocked right-looking version of the algorithm,
   calling Level 3 BLAS to update the submatrix. To factorize a block,
   this routine calls the recursive routine CLAUNHR_COL_GETRFNP2.

   [1] "Reconstructing Householder vectors from tall-skinny QR",
       G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen,
       E. Solomonik, J. Parallel Distrib. Comput.,
       vol. 85, pp. 3-31, 2015.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is COMPLEX array, dimension (LDA,N)

    On entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • D – [out]

    D is COMPLEX array, dimension min(M,N)

    The diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only (+1.0, 0.0) or (-1.0, 0.0).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

LAORHR_COL_GETRFNP#

group laorhr_col_getrfnp

Functions

template<typename T>
void laorhr_col_getrfnp(integer *m, integer *n, T *a, integer *lda, T *d, integer *info)#

LAORHR_COL_GETRFNP computes the modified LU factorization without pivoting of a real general M-by-N matrix A.

Purpose:

   LAORHR_COL_GETRFNP computes the modified LU factorization without
   pivoting of a real general M-by-N matrix A. The factorization has
   the form:

       A - S = L * U,

   where:
      S is a m-by-n diagonal sign matrix with the diagonal D, so that
      D(i) = S(i,i), 1 <= i <= min(M,N). The diagonal D is constructed
      as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing
      i-1 steps of Gaussian elimination. This means that the diagonal
      element at each step of "modified" Gaussian elimination is
      at least one in absolute value (so that division-by-zero not
      not possible during the division by the diagonal element);

      L is a M-by-N lower triangular matrix with unit diagonal elements
      (lower trapezoidal if M > N);

      and U is a M-by-N upper triangular matrix
      (upper trapezoidal if M < N).

   This routine is an auxiliary routine used in the Householder
   reconstruction routine SORHR_COL. In SORHR_COL, this routine is
   applied to an M-by-N matrix A with orthonormal columns, where each
   element is bounded by one in absolute value. With the choice of
   the matrix S above, one can show that the diagonal element at each
   step of Gaussian elimination is the largest (in absolute value) in
   the column on or below the diagonal, so that no pivoting is required
   for numerical stability [1].

   For more details on the Householder reconstruction algorithm,
   including the modified LU factorization, see [1].

   This is the blocked right-looking version of the algorithm,
   calling Level 3 BLAS to update the submatrix. To factorize a block,
   this routine calls the recursive routine SLAORHR_COL_GETRFNP2.

   [1] "Reconstructing Householder vectors from tall-skinny QR",
       G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen,
       E. Solomonik, J. Parallel Distrib. Comput.,
       vol. 85, pp. 3-31, 2015.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • D – [out]

    D is REAL array, dimension min(M,N)

    The diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only plus or minus one.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

LAUNHR_COL_GETRFNP2#

group launhr_col_getrfnp2

Functions

template<typename T>
void launhr_col_getrfnp2(integer *m, integer *n, T *a, integer *lda, T *d, integer *info)#

LAUNHR_COL_GETRFNP2 computes the modified LU factorization without pivoting of a real general M-by-N matrix A.

Purpose:

   LAUNHR_COL_GETRFNP2 computes the modified LU factorization without
   pivoting of a complex general M-by-N matrix A. The factorization has
   the form:

       A - S = L * U,

   where:
      S is a m-by-n diagonal sign matrix with the diagonal D, so that
      D(i) = S(i,i), 1 <= i <= min(M,N). The diagonal D is constructed
      as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing
      i-1 steps of Gaussian elimination. This means that the diagonal
      element at each step of "modified" Gaussian elimination is at
      least one in absolute value (so that division-by-zero not
      possible during the division by the diagonal element);

      L is a M-by-N lower triangular matrix with unit diagonal elements
      (lower trapezoidal if M > N);

      and U is a M-by-N upper triangular matrix
      (upper trapezoidal if M < N).

   This routine is an auxiliary routine used in the Householder
   reconstruction routine CUNHR_COL. In CUNHR_COL, this routine is
   applied to an M-by-N matrix A with orthonormal columns, where each
   element is bounded by one in absolute value. With the choice of
   the matrix S above, one can show that the diagonal element at each
   step of Gaussian elimination is the largest (in absolute value) in
   the column on or below the diagonal, so that no pivoting is required
   for numerical stability [1].

   For more details on the Householder reconstruction algorithm,
   including the modified LU factorization, see [1].

   This is the recursive version of the LU factorization algorithm.
   Denote A - S by B. The algorithm divides the matrix B into four
   submatrices:

          [  B11 | B12  ]  where B11 is n1 by n1,
      B = [ -----|----- ]        B21 is (m-n1) by n1,
          [  B21 | B22  ]        B12 is n1 by n2,
                                 B22 is (m-n1) by n2,
                                 with n1 = min(m,n)/2, n2 = n-n1.


   The subroutine calls itself to factor B11, solves for B21,
   solves for B12, updates B22, then calls itself to factor B22.

   For more details on the recursive LU algorithm, see [2].

   CLAUNHR_COL_GETRFNP2 is called to factorize a block by the blocked
   routine CLAUNHR_COL_GETRFNP, which uses blocked code calling
  *. Level 3 BLAS to update the submatrix. However, CLAUNHR_COL_GETRFNP2
   is self-sufficient and can be used without CLAUNHR_COL_GETRFNP.

   [1] "Reconstructing Householder vectors from tall-skinny QR",
       G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen,
       E. Solomonik, J. Parallel Distrib. Comput.,
       vol. 85, pp. 3-31, 2015.

   [2] "Recursion leads to automatic variable blocking for dense linear
       algebra algorithms", F. Gustavson, IBM J. of Res. and Dev.,
       vol. 41, no. 6, pp. 737-755, 1997.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is COMPLEX array, dimension (LDA,N)

    On entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • D – [out]

    D is COMPLEX array, dimension min(M,N)

    The diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only (+1.0, 0.0) or (-1.0, 0.0).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

LAORHR_COL_GETRFNP2#

group laorhr_col_getrfnp2

Functions

template<typename T>
void laorhr_col_getrfnp2(integer *m, integer *n, T *a, integer *lda, T *d, integer *info)#

LAORHR_COL_GETRFNP2 computes the modified LU factorization without pivoting of a real general M-by-N matrix A.

Purpose:

   LAORHR_COL_GETRFNP2 computes the modified LU factorization without
   pivoting of a real general M-by-N matrix A. The factorization has
   the form:

       A - S = L * U,

   where:
      S is a m-by-n diagonal sign matrix with the diagonal D, so that
      D(i) = S(i,i), 1 <= i <= min(M,N). The diagonal D is constructed
      as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing
      i-1 steps of Gaussian elimination. This means that the diagonal
      element at each step of "modified" Gaussian elimination is at
      least one in absolute value (so that division-by-zero not
      possible during the division by the diagonal element);

      L is a M-by-N lower triangular matrix with unit diagonal elements
      (lower trapezoidal if M > N);

      and U is a M-by-N upper triangular matrix
      (upper trapezoidal if M < N).

   This routine is an auxiliary routine used in the Householder
   reconstruction routine SORHR_COL. In SORHR_COL, this routine is
   applied to an M-by-N matrix A with orthonormal columns, where each
   element is bounded by one in absolute value. With the choice of
   the matrix S above, one can show that the diagonal element at each
   step of Gaussian elimination is the largest (in absolute value) in
   the column on or below the diagonal, so that no pivoting is required
   for numerical stability [1].

   For more details on the Householder reconstruction algorithm,
   including the modified LU factorization, see [1].

   This is the recursive version of the LU factorization algorithm.
   Denote A - S by B. The algorithm divides the matrix B into four
   submatrices:

          [  B11 | B12  ]  where B11 is n1 by n1,
      B = [ -----|----- ]        B21 is (m-n1) by n1,
          [  B21 | B22  ]        B12 is n1 by n2,
                                 B22 is (m-n1) by n2,
                                 with n1 = min(m,n)/2, n2 = n-n1.


   The subroutine calls itself to factor B11, solves for B21,
   solves for B12, updates B22, then calls itself to factor B22.

   For more details on the recursive LU algorithm, see [2].

   SLAORHR_COL_GETRFNP2 is called to factorize a block by the blocked
   routine SLAORHR_COL_GETRFNP, which uses blocked code calling
  *. Level 3 BLAS to update the submatrix. However, SLAORHR_COL_GETRFNP2
   is self-sufficient and can be used without SLAORHR_COL_GETRFNP.

   [1] "Reconstructing Householder vectors from tall-skinny QR",
       G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen,
       E. Solomonik, J. Parallel Distrib. Comput.,
       vol. 85, pp. 3-31, 2015.

   [2] "Recursion leads to automatic variable blocking for dense linear
       algebra algorithms", F. Gustavson, IBM J. of Res. and Dev.,
       vol. 41, no. 6, pp. 737-755, 1997.

Parameters:
  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • D – [out]

    D is REAL array, dimension min(M,N)

    The diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only plus or minus one.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPQRT#

group tpqrt

Functions

template<typename T>
void tpqrt(integer *m, integer *n, integer *l, integer *nb, T *a, integer *lda, T *b, integer *ldb, T *t, integer *ldt, T *work, integer *info)#

TPQRT computes a blocked QR factorization of a real triangular-pentagonal matrix.

Purpose:

  TPQRT computes a blocked QR factorization of a real
  "triangular-pentagonal" matrix C, which is composed of a
  triangular block A and pentagonal block B, using the compact
  WY representation for Q.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix B.

    M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix B, and the order of the triangular matrix A. N >= 0.

  • L – [in]

    L is INTEGER

    The number of rows of the upper trapezoidal part of B. MIN(M,N) >= L >= 0. See Further Details.

  • NB – [in]

    NB is INTEGER

    The block size to be used in the blocked QR. N >= NB >= 1.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the upper triangular N-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the upper triangular matrix R.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • B – [inout]

    B is REAL array, dimension (LDB,N)

    On entry, the pentagonal M-by-N matrix B. The first M-L rows are rectangular, and the last L rows are upper trapezoidal.

    On exit, B contains the pentagonal matrix V. See Further Details.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT,N)

    The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See Further Details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • WORK – [out] WORK is REAL array, dimension (NB*N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPQRT2#

group tpqrt2

Functions

template<typename T>
void tpqrt2(integer *m, integer *n, integer *l, T *a, integer *lda, T *b, integer *ldb, T *t, integer *ldt, integer *info)#

TPQRT2 computes a QR factorization of a real or complex

”triangular-pentagonal” matrix, which is composed of a triangular block

and a pentagonal block, using the compact WY representation for Q.

Purpose:

  TPQRT2 computes a QR factorization of a real "triangular-pentagonal"
  matrix C, which is composed of a triangular block A and pentagonal block B,
  using the compact WY representation for Q.

Parameters:
  • M – [in]

    M is INTEGER

    The total number of rows of the matrix B. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix B, and the order of the triangular matrix A. N >= 0.

  • L – [in]

    L is INTEGER

    The number of rows of the upper trapezoidal part of B. MIN(M,N) >= L >= 0. See Further Details.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the upper triangular N-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the upper triangular matrix R.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • B – [inout]

    B is REAL array, dimension (LDB,N)

    On entry, the pentagonal M-by-N matrix B. The first M-L rows are rectangular, and the last L rows are upper trapezoidal. On exit, B contains the pentagonal matrix V. See Further Details.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

  • T – [out]

    T is REAL array, dimension (LDT,N)

    The N-by-N upper triangular factor T of the block reflector. See Further Details.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= fla_max(1,N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPMQRT#

group tpmqrt

Functions

template<typename T>
void tpmqrt(char *side, char *trans, integer *m, integer *n, integer *k, integer *l, integer *nb, T *v, integer *ldv, T *t, integer *ldt, T *a, integer *lda, T *b, integer *ldb, T *work, integer *info)#

TPMQRT applies a real orthogonal matrix Q obtained from a

triangular-pentagonal.

Purpose:

 TPMQRT applies a real orthogonal matrix Q obtained from a
 "triangular-pentagonal" real block reflector H to a general
 real matrix C, which consists of two blocks A and B.

Parameters:
  • SIDE – [in]

    SIDE is CHARACTER*1

    = ‘L’: apply Q or Q^T from the Left;

    = ‘R’: apply Q or Q^T from the Right.

  • TRANS – [in]

    TRANS is CHARACTER*1

    = ‘N’: No transpose, apply Q;

    = ‘T’: Transpose, apply Q^T.

  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • K – [in]

    K is INTEGER

    The number of elementary reflectors whose product defines the matrix Q.

  • L – [in]

    L is INTEGER

    The order of the trapezoidal part of V. K >= L >= 0. See Further Details.

  • NB – [in]

    NB is INTEGER

    The block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in CTPQRT.

  • V – [in]

    V is REAL array, dimension (LDV,K)

    The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,…,k, as returned by CTPQRT in B. See Further Details.

  • LDV – [in]

    LDV is INTEGER

    The leading dimension of the array V.

    If SIDE = ‘L’, LDV >= fla_max(1,M);

    if SIDE = ‘R’, LDV >= fla_max(1,N).

  • T – [in]

    T is REAL array, dimension (LDT,K)

    The upper triangular factors of the block reflectors as returned by CTPQRT, stored as a NB-by-K matrix.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= NB.

  • A – [inout]

    A is REAL array, dimension

    (LDA,N) if SIDE = ‘L’ or

    (LDA,K) if SIDE = ‘R’

    On entry, the K-by-N or M-by-K matrix A. On exit, A is overwritten by the corresponding block of Q*C or Q^T*C or C*Q or C*Q^T. See Further Details.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A

    If SIDE = ‘L’, LDC >= fla_max(1,K);

    If SIDE = ‘R’, LDC >= fla_max(1,M).

  • B – [inout]

    B is REAL array, dimension (LDB,N)

    On entry, the M-by-N matrix B.

    On exit, B is overwritten by the corresponding block of Q*C or Q^T*C or C*Q or C*Q^T. See Further Details.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

  • WORK – [out] WORK is REAL array. The dimension of WORK is N*NB if SIDE = ‘L’, or M*NB if SIDE = ‘R’.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPRFB#

group tprfb

Functions

template<typename T>
void tprfb(char *side, char *trans, char *direct, char *storev, integer *m, integer *n, integer *k, integer *l, T *v, integer *ldv, T *t, integer *ldt, T *a, integer *lda, T *b, integer *ldb, T *work, integer *ldwork)#

TPRFB applies a real or complex “triangular-pentagonal” blocked

reflector to a real or complex matrix, which is composed of two blocks.

Purpose:

  TPRFB applies a real "triangular-pentagonal" block reflector H or its
  conjugate transpose H^H to a real matrix C, which is composed of two
  blocks A and B, either from the left or right.

Parameters:
  • SIDE – [in]

    SIDE is CHARACTER*1

    = ‘L’: apply H or H^H from the Left

    = ‘R’: apply H or H^H from the Right

  • TRANS – [in]

    TRANS is CHARACTER*1

    = ‘N’: apply H (No transpose)

    = ‘C’: apply H^H (Conjugate transpose)

  • DIRECT – [in]

    DIRECT is CHARACTER*1

    Indicates how H is formed from a product of elementary reflectors

    = ‘F’: H = H(1) H(2) … H(k) (Forward)

    = ‘B’: H = H(k) … H(2) H(1) (Backward)

  • STOREV – [in]

    STOREV is CHARACTER*1

    Indicates how the vectors which define the elementary reflectors are stored:

    = ‘C’: Columns

    = ‘R’: Rows

  • M – [in]

    M is INTEGER

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

  • N – [in]

    N is INTEGER

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

  • K – [in]

    K is INTEGER

    The order of the matrix T, i.e. the number of elementary reflectors whose product defines the block reflector. K >= 0.

  • L – [in]

    L is INTEGER

    The order of the trapezoidal part of V. K >= L >= 0. See Further Details.

  • V – [in]

    V is REAL array, dimension

    (LDV,K) if STOREV = ‘C’

    (LDV,M) if STOREV = ‘R’ and SIDE = ‘L’

    (LDV,N) if STOREV = ‘R’ and SIDE = ‘R’

    The pentagonal matrix V, which contains the elementary reflectors H(1), H(2), …, H(K). See Further Details.

  • LDV – [in]

    LDV is INTEGER

    The leading dimension of the array V.

    If STOREV = ‘C’ and SIDE = ‘L’, LDV >= fla_max(1,M);

    if STOREV = ‘C’ and SIDE = ‘R’, LDV >= fla_max(1,N);

    if STOREV = ‘R’, LDV >= K.

  • T – [in]

    T is REAL array, dimension (LDT,K)

    The triangular K-by-K matrix T in the representation of the block reflector.

  • LDT – [in]

    LDT is INTEGER

    The leading dimension of the array T. LDT >= K.

  • A – [inout]

    A is REAL array, dimension (LDA,N) if SIDE = ‘L’ or (LDA,K) if SIDE = ‘R’

    On entry, the K-by-N or M-by-K matrix A.

    On exit, A is overwritten by the corresponding block of H*C or H^H*C or C*H or C*H^H. See Further Details.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A.

    If SIDE = ‘L’, LDA >= fla_max(1,K);

    If SIDE = ‘R’, LDA >= fla_max(1,M).

  • B – [inout]

    B is REAL array, dimension (LDB,N)

    On entry, the M-by-N matrix B. On exit, B is overwritten by the corresponding block of H*C or H^H*C or C*H or C*H^H. See Further Details.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

  • WORK – [out]

    WORK is REAL array, dimension

    (LDWORK,N) if SIDE = ‘L’,

    (LDWORK,K) if SIDE = ‘R’.

  • LDWORK – [in]

    LDWORK is INTEGER

    The leading dimension of the array WORK.

    If SIDE = ‘L’, LDWORK >= K;

    if SIDE = ‘R’, LDWORK >= M.

GGQRF#

group ggqrf

Functions

template<typename T>
void ggqrf(integer *n, integer *m, integer *p, T *a, integer *lda, T *taua, T *b, integer *ldb, T *taub, T *work, integer *lwork, integer *info)#

GGQRF computes a generalized QR factorization of an N-by-M matrix A and an N-by-P matrix B.

Purpose:

    GGQRF 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.

Parameters:
  • N – [in]

    N is INTEGER

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

  • M – [in]

    M is INTEGER

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

  • P – [in]

    P is INTEGER

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

  • A – [inout]

    A is REAL array, dimension (LDA,M)

    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).

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • TAUA – [out]

    TAUA is REAL array, dimension (min(N,M))

    The scalar factors of the elementary reflectors which represent the orthogonal matrix Q (see Further Details).

  • B – [inout]

    B is REAL array, dimension (LDB,P)

    On entry, the N-by-P matrix B.

    On exit, if N <= P, the upper triangle of the subarray B(1:N,P-N+1:P) 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).

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • TAUB – [out]

    TAUB is REAL array, dimension (min(N,P))

    The scalar factors of the elementary reflectors which represent the orthogonal matrix Z (see Further Details).

  • WORK – [out]

    WORK is REAL array, dimension (MAX(1,LWORK))

    On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N,M,P). For optimum performance LWORK >= fla_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, and no error message related to LWORK is issued by XERBLA.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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