12#ifndef TLAPACK_GERQF_HH
13#define TLAPACK_GERQF_HH
40template <
class T, TLAPACK_SMATRIX A_t, TLAPACK_SVECTOR tau_t>
50 const idx_t m = nrows(
A);
51 const idx_t n = ncols(
A);
52 const idx_t
k = min(m, n);
53 const idx_t nb = min((idx_t)
opts.nb,
k);
79template <TLAPACK_SMATRIX A_t, TLAPACK_SVECTOR tau_t, TLAPACK_WORKSPACE work_t>
86 const idx_t m = nrows(
A);
87 const idx_t n = ncols(
A);
88 const idx_t
k = min(m, n);
89 const idx_t nb = min((idx_t)
opts.nb,
k);
95 auto [
TT,
work2] = (m > nb) ? reshape(
work, nb, nb) : reshape(
work, 0, 0);
98 for (idx_t
j2 = 0;
j2 <
k;
j2 += nb) {
99 const idx_t
ib = min(nb,
k -
j2);
100 const idx_t j = m -
j2 -
ib;
159template <TLAPACK_SMATRIX A_t, TLAPACK_SVECTOR tau_t>
168 std::vector<T>
work_;
int gerqf(A_t &A, tau_t &tau, const GerqfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm.
Definition gerqf.hpp:160
int larfb_work(side_t side, trans_t trans, direction_t direction, storage_t storeMode, const matrixV_t &V, const matrixT_t &Tmatrix, matrixC_t &C, work_t &work)
Applies a block reflector or its conjugate transpose to a m-by-n matrix C, from either the left or ...
Definition larfb.hpp:111
int larft(direction_t direction, storage_t storeMode, const matrixV_t &V, const vector_t &tau, matrixT_t &T)
Forms the triangular factor T of a block reflector H of order n, which is defined as a product of k e...
Definition larft.hpp:92
int gerq2_work(matrix_t &A, vector_t &tau, work_t &work)
Computes an RQ factorization of a matrix A. Workspace is provided as an argument.
Definition gerq2.hpp:60
int gerqf_work(A_t &A, tau_t &tau, work_t &work, const GerqfOpts &opts={})
Computes an RQ factorization of an m-by-n matrix A using a blocked algorithm. Workspace is provided...
Definition gerqf.hpp:80
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
constexpr WorkInfo gerqf_worksize(const A_t &A, const tau_t &tau, const GerqfOpts &opts={})
Worspace query of gerqf()
Definition gerqf.hpp:41
Applies a Householder block reflector to a matrix.
Forms the triangular factor T of a block reflector.
Sort the numbers in D in increasing order (if ID = 'I') or in decreasing order (if ID = 'D' ).
Definition arrayTraits.hpp:15
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
constexpr internal::Backward BACKWARD
Backward direction.
Definition types.hpp:383
constexpr internal::RightSide RIGHT_SIDE
right side
Definition types.hpp:296
constexpr internal::RowwiseStorage ROWWISE_STORAGE
Rowwise storage.
Definition types.hpp:416
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
Options struct for gerqf.
Definition gerqf.hpp:24
size_t nb
Block size.
Definition gerqf.hpp:25
Output information in the workspace query.
Definition workspace.hpp:16