12#ifndef TLAPACK_GERQ2_HH
13#define TLAPACK_GERQ2_HH
31template <
class T, TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
38 const idx_t m = nrows(
A);
41 auto&&
C = rows(
A,
range{1, m});
43 row(
A, 0),
tau[0],
C);
66 const idx_t m = nrows(
A);
67 const idx_t n = ncols(
A);
68 const idx_t
k = min(m, n);
76 for (idx_t
i2 = 0;
i2 <
k; ++
i2) {
129template <TLAPACK_SMATRIX matrix_t, TLAPACK_VECTOR vector_t>
139 const idx_t n = ncols(
A);
142 if (n <= 0)
return 0;
146 std::vector<T>
work_;
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
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
int gerq2(matrix_t &A, vector_t &tau)
Computes an RQ factorization of a matrix A.
Definition gerq2.hpp:130
void larfg(storage_t storeMode, type_t< vector_t > &alpha, vector_t &x, type_t< vector_t > &tau)
Generates a elementary Householder reflection.
Definition larfg.hpp:73
void larf_work(side_t side, storage_t storeMode, vector_t const &x, const tau_t &tau, vectorC0_t &C0, matrixC1_t &C1, work_t &work)
Applies an elementary reflector defined by tau and v to a m-by-n matrix C decomposed into C0 and C1....
Definition larf.hpp:48
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
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
constexpr WorkInfo gerq2_worksize(const matrix_t &A, const vector_t &tau)
Worspace query of gerq2()
Definition gerq2.hpp:32
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
Output information in the workspace query.
Definition workspace.hpp:16