LAPACK++ 2024.05.31
LAPACK C++ API
Loading...
Searching...
No Matches

Functions

int64_t lapack::gerq2 (int64_t m, int64_t n, double *A, int64_t lda, double *tau)
 
int64_t lapack::gerq2 (int64_t m, int64_t n, float *A, int64_t lda, float *tau)
 
int64_t lapack::gerq2 (int64_t m, int64_t n, std::complex< double > *A, int64_t lda, std::complex< double > *tau)
 Computes an RQ factorization of an m-by-n matrix A: \(A = R Q\).
 
int64_t lapack::gerq2 (int64_t m, int64_t n, std::complex< float > *A, int64_t lda, std::complex< float > *tau)
 
int64_t lapack::gerqf (int64_t m, int64_t n, double *A, int64_t lda, double *tau)
 
int64_t lapack::gerqf (int64_t m, int64_t n, float *A, int64_t lda, float *tau)
 
int64_t lapack::gerqf (int64_t m, int64_t n, std::complex< double > *A, int64_t lda, std::complex< double > *tau)
 Computes an RQ factorization of an m-by-n matrix A: \(A = R Q\).
 
int64_t lapack::gerqf (int64_t m, int64_t n, std::complex< float > *A, int64_t lda, std::complex< float > *tau)
 
int64_t lapack::orgrq (int64_t m, int64_t n, int64_t k, double *A, int64_t lda, double const *tau)
 
int64_t lapack::orgrq (int64_t m, int64_t n, int64_t k, float *A, int64_t lda, float const *tau)
 
int64_t lapack::ormrq (lapack::Side side, lapack::Op trans, int64_t m, int64_t n, int64_t k, double const *A, int64_t lda, double const *tau, double *C, int64_t ldc)
 
int64_t lapack::ormrq (lapack::Side side, lapack::Op trans, int64_t m, int64_t n, int64_t k, float const *A, int64_t lda, float const *tau, float *C, int64_t ldc)
 
int64_t lapack::ungrq (int64_t m, int64_t n, int64_t k, std::complex< double > *A, int64_t lda, std::complex< double > const *tau)
 Generates an m-by-n matrix Q with orthonormal rows, which is defined as the last m rows of a product of k elementary reflectors of order n, as returned by lapack::gerqf:
 
int64_t lapack::ungrq (int64_t m, int64_t n, int64_t k, std::complex< float > *A, int64_t lda, std::complex< float > const *tau)
 
int64_t lapack::unmrq (lapack::Side side, lapack::Op trans, int64_t m, int64_t n, int64_t k, std::complex< double > const *A, int64_t lda, std::complex< double > const *tau, std::complex< double > *C, int64_t ldc)
 Multiplies the general m-by-n matrix C by Q from lapack::gerqf as follows:
 
int64_t lapack::unmrq (lapack::Side side, lapack::Op trans, int64_t m, int64_t n, int64_t k, std::complex< float > const *A, int64_t lda, std::complex< float > const *tau, std::complex< float > *C, int64_t ldc)
 

Detailed Description

Function Documentation

◆ gerq2()

int64_t lapack::gerq2 ( int64_t  m,
int64_t  n,
std::complex< double > *  A,
int64_t  lda,
std::complex< double > *  tau 
)

Computes an RQ factorization of an m-by-n matrix A: \(A = R Q\).

This is the unblocked Level 2 BLAS version of the algorithm.

Overloaded versions are available for float, double, std::complex<float>, and std::complex<double>.

Parameters
[in]mThe number of rows of the matrix A. m >= 0.
[in]nThe number of columns of the matrix A. n >= 0.
[in,out]AThe m-by-n matrix A, stored in an lda-by-n array. On entry, the m-by-n matrix A. On exit:
  • if m <= n, the upper triangle of the subarray A(1:m,n-m+1:n) contains the m-by-m upper triangular matrix R;
  • if m >= n, the elements on and above the (m-n)-th subdiagonal contain the m-by-n upper trapezoidal matrix R.
  • The remaining elements, with the array tau, represent the unitary matrix Q as a product of min(m,n) elementary reflectors (see Further Details).
[in]ldaThe leading dimension of the array A. lda >= max(1,m).
[out]tauThe vector tau of length min(m,n). The scalar factors of the elementary reflectors (see Further Details).
Returns
= 0: successful exit
Further Details

The matrix Q is represented as a product of elementary reflectors

\[ Q = H(1)^H H(2)^H \dots H(k)^H, \text{ where } k = \min(m,n). \]

Each H(i) has the form

\[ H(i) = I - \tau v v^H \]

where \(\tau\) is a scalar, and v is a vector with v(n-k+i+1:n) = 0 and v(n-k+i) = 1; conj(v(1:n-k+i-1)) is stored on exit in A(m-k+i,1:n-k+i-1), and \(\tau\) in tau(i).

◆ gerqf()

int64_t lapack::gerqf ( int64_t  m,
int64_t  n,
std::complex< double > *  A,
int64_t  lda,
std::complex< double > *  tau 
)

Computes an RQ factorization of an m-by-n matrix A: \(A = R Q\).

This is the blocked Level 3 BLAS version of the algorithm.

Overloaded versions are available for float, double, std::complex<float>, and std::complex<double>.

Parameters
[in]mThe number of rows of the matrix A. m >= 0.
[in]nThe number of columns of the matrix A. n >= 0.
[in,out]AThe m-by-n matrix A, stored in an lda-by-n array. On entry, the m-by-n matrix A. On exit:
  • if m <= n, the upper triangle of the subarray A(1:m,n-m+1:n) contains the m-by-m upper triangular matrix R;
  • if m >= n, the elements on and above the (m-n)-th subdiagonal contain the m-by-n upper trapezoidal matrix R.
  • The remaining elements, with the array tau, represent the unitary matrix Q as a product of min(m,n) elementary reflectors (see Further Details).
[in]ldaThe leading dimension of the array A. lda >= max(1,m).
[out]tauThe vector tau of length min(m,n). The scalar factors of the elementary reflectors (see Further Details).
Returns
= 0: successful exit
Further Details

The matrix Q is represented as a product of elementary reflectors

\[ Q = H(1)^H H(2)^H \dots H(k)^H, \text{ where } k = \min(m,n). \]

Each H(i) has the form

\[ H(i) = I - \tau v v^H \]

where \(\tau\) is a scalar, and v is a vector with v(n-k+i+1:n) = 0 and v(n-k+i) = 1; conj(v(1:n-k+i-1)) is stored on exit in A(m-k+i,1:n-k+i-1), and \(\tau\) in tau(i).

◆ orgrq()

int64_t lapack::orgrq ( int64_t  m,
int64_t  n,
int64_t  k,
double *  A,
int64_t  lda,
double const *  tau 
)
See also
lapack::ungrq

◆ ormrq()

int64_t lapack::ormrq ( lapack::Side  side,
lapack::Op  trans,
int64_t  m,
int64_t  n,
int64_t  k,
double const *  A,
int64_t  lda,
double const *  tau,
double *  C,
int64_t  ldc 
)
See also
lapack::unmrq

◆ ungrq()

int64_t lapack::ungrq ( int64_t  m,
int64_t  n,
int64_t  k,
std::complex< double > *  A,
int64_t  lda,
std::complex< double > const *  tau 
)

Generates an m-by-n matrix Q with orthonormal rows, which is defined as the last m rows of a product of k elementary reflectors of order n, as returned by lapack::gerqf:

\[ Q = H(1)^H H(2)^H \dots H(k)^H. \]

Overloaded versions are available for float, double, std::complex<float>, and std::complex<double>. For real matrices, this is an alias for lapack::ormrq.

Parameters
[in]mThe number of rows of the matrix Q. m >= 0.
[in]nThe number of columns of the matrix Q. n >= m.
[in]kThe number of elementary reflectors whose product defines the matrix Q. m >= k >= 0.
[in,out]AThe m-by-n matrix A, stored in an lda-by-n array. On entry, the (m-k+i)-th row must contain the vector which defines the elementary reflector H(i), for i = 1, 2, ..., k, as returned by lapack::gerqf in the last k rows of its array argument A. On exit, the m-by-n matrix Q.
[in]ldaThe first dimension of the array A. lda >= max(1,m).
[in]tauThe vector tau of length k. tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by lapack::gerqf.
Returns
= 0: successful exit

◆ unmrq()

int64_t lapack::unmrq ( lapack::Side  side,
lapack::Op  trans,
int64_t  m,
int64_t  n,
int64_t  k,
std::complex< double > const *  A,
int64_t  lda,
std::complex< double > const *  tau,
std::complex< double > *  C,
int64_t  ldc 
)

Multiplies the general m-by-n matrix C by Q from lapack::gerqf as follows:

  • side = Left, trans = NoTrans: \(Q C\)
  • side = Right, trans = NoTrans: \(C Q\)
  • side = Left, trans = ConjTrans: \(Q^H C\)
  • side = Right, trans = ConjTrans: \(C Q^H\)

where Q is a unitary matrix defined as the product of k elementary reflectors, as returned by lapack::gerqf:

\[ Q = H(1)^H H(2)^H \dots H(k)^H. \]

Q is of order m if side = Left and of order n if side = Right.

Overloaded versions are available for float, double, std::complex<float>, and std::complex<double>. For real matrices, this is an alias for lapack::ormrq.

Parameters
[in]side
  • lapack::Side::Left: apply \(Q\) or \(Q^H\) from the Left;
  • lapack::Side::Right: apply \(Q\) or \(Q^H\) from the Right.
[in]trans
  • lapack::Op::NoTrans: No transpose, apply \(Q\);
  • lapack::Op::ConjTrans: Transpose, apply \(Q^H\).
[in]mThe number of rows of the matrix C. m >= 0.
[in]nThe number of columns of the matrix C. n >= 0.
[in]kThe number of elementary reflectors whose product defines the matrix Q.
  • If side = Left, m >= k >= 0;
  • if side = Right, n >= k >= 0.
[in]A
  • If side = Left, the k-by-m matrix A, stored in an lda-by-m array;
  • if side = Right, the k-by-n matrix A, stored in an lda-by-n array.
    The i-th row must contain the vector which defines the elementary reflector H(i), for i = 1, 2, ..., k, as returned by lapack::gerqf in the last k rows of its array argument A.
[in]ldaThe leading dimension of the array A. lda >= max(1,k).
[in]tauThe vector tau of length k. tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by lapack::gerqf.
[in,out]CThe m-by-n matrix C, stored in an ldc-by-n array. 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\).
[in]ldcThe leading dimension of the array C. ldc >= max(1,m).
Returns
= 0: successful exit