10#ifndef TLAPACK_UNGTR_HH
11#define TLAPACK_UNGTR_HH
41template <TLAPACK_SMATRIX Q_t, TLAPACK_SVECTOR tau_t,
class uplo_t>
50 const idx_t n = ncols(
Q);
57 if (
uplo == Uplo::Lower) {
59 for (idx_t
j2 = n - 1;
j2 > 1; --
j2) {
61 for (idx_t i = j + 1; i < n; ++i)
62 Q(i, j) =
Q(i, j - 1);
66 for (idx_t i = 1; i < n; ++i) {
73 auto Qrefl = slice(
Q, pair(1, n), pair(1, n));
79 for (idx_t j = 1; j < n - 1; ++j)
80 for (idx_t i = 0; i < j; ++i)
81 Q(i, j) =
Q(i, j + 1);
84 for (idx_t i = 0; i < n - 1; ++i) {
88 Q(n - 1, n - 1) =
one;
91 auto Qrefl = slice(
Q, pair(0, n - 1), pair(0, n - 1));
int ungqr(matrix_t &A, const vector_t &tau, const UngqrOpts &opts={})
Generates a matrix Q with orthogonal columns.
Definition ungqr.hpp:52
int ungql(matrix_t &A, const vector_t &tau, const UngqlOpts &opts={})
Generates an m-by-n matrix Q with orthonormal columns, which is defined as the last n columns of a pr...
Definition ungql.hpp:55
int ungtr(uplo_t uplo, Q_t &Q, const tau_t &tau)
Generates a real orthogonal matrix Q which is defined as the product of k elementary reflectors of or...
Definition ungtr.hpp:42
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