13#ifndef TLAPACK_UNGQ_HH
14#define TLAPACK_UNGQ_HH
70 const idx_t m = nrows(
A);
71 const idx_t n = ncols(
A);
72 const idx_t
k = size(
tau);
73 const idx_t nb = min((idx_t)
opts.nb,
k);
85 auto&&
C = slice(
A,
range{0, m},
88 :
range{0, (n -
k) + ((
k - 1) / nb) * nb});
106 :
range{0, (m -
k) + ((
k - 1) / nb) * nb},
153 const idx_t m = nrows(
A);
154 const idx_t n = ncols(
A);
155 const idx_t
k = size(
tau);
156 const idx_t nb = min((idx_t)
opts.nb,
k);
162 : (n >= m && m >=
k));
165 if (m <= 0 || n <= 0)
return 0;
169 (min(m, n) > nb) ? reshape(
work, nb, nb) : reshape(
work, 0, 0);
179 for (idx_t j = ((
k - 1) / nb) * nb; j != -nb; j -= nb) {
180 const idx_t
ib = min(nb,
k - j);
211 for (idx_t j = 0; j <
k; j += nb) {
212 const idx_t
ib = min(nb,
k - j);
214 const idx_t
jj = n -
k + j;
246 for (idx_t i = ((
k - 1) / nb) * nb; i != -nb; i -= nb) {
247 const idx_t
ib = min(nb,
k - i);
278 for (idx_t i = 0; i <
k; i += nb) {
279 const idx_t
ib = min(nb,
k - i);
281 const idx_t
ii = m -
k + i;
366 const idx_t m = nrows(
A);
367 const idx_t n = ncols(
A);
370 if (m <= 0 || n <= 0)
return 0;
374 std::vector<T>
work_;
#define TLAPACK_SVECTOR
Macro for tlapack::concepts::SliceableVector compatible with C++17.
Definition concepts.hpp:909
#define TLAPACK_STOREV
Macro for tlapack::concepts::StoreV compatible with C++17.
Definition concepts.hpp:936
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
#define TLAPACK_DIRECTION
Macro for tlapack::concepts::Direction compatible with C++17.
Definition concepts.hpp:930
#define TLAPACK_WORKSPACE
Macro for tlapack::concepts::Workspace compatible with C++17.
Definition concepts.hpp:912
int ungq(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, const UngqOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors.
Definition ungq.hpp:352
void laset(uplo_t uplo, const type_t< matrix_t > &alpha, const type_t< matrix_t > &beta, matrix_t &A)
Initializes a matrix to diagonal and off-diagonal values.
Definition laset.hpp:38
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 ungq_work(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, work_t &work, const UngqOpts &opts={})
Generates a matrix Q that is the product of elementary reflectors. Workspace is provided as an argu...
Definition ungq.hpp:138
int ungq_level2_work(direction_t direction, storage_t storeMode, matrix_t &A, const vector_t &tau, work_t &work)
Generates a matrix Q that is the product of elementary reflectors. Workspace is provided as an argu...
Definition ungq_level2.hpp:90
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
constexpr WorkInfo ungq_worksize(direction_t direction, storage_t storeMode, const matrix_t &A, const vector_t &tau, const UngqOpts &opts={})
Worspace query of ungq()
Definition ungq.hpp:59
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::Forward FORWARD
Forward direction.
Definition types.hpp:381
constexpr internal::GeneralAccess GENERAL
General access.
Definition types.hpp:180
@ Forward
Forward direction.
@ Backward
Backward direction.
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:264
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:414
@ Columnwise
Columnwise storage.
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:294
Options struct for ungq.
Definition ungq.hpp:26
size_t nb
Block size.
Definition ungq.hpp:27
Output information in the workspace query.
Definition workspace.hpp:16