12#ifndef TLAPACK_LARFT_HH
13#define TLAPACK_LARFT_HH
110 const idx_t n = (
storeMode == StoreV::Columnwise) ? nrows(
V) : ncols(
V);
111 const idx_t
k = size(
tau);
115 direction != Direction::Forward);
119 k > ((
storeMode == StoreV::Columnwise) ? ncols(
V) : nrows(
V)));
123 if (n == 0 ||
k == 0)
return 0;
125 if (direction == Direction::Forward) {
130 for (idx_t i = 1; i <
k; ++i) {
132 auto t = slice(T,
range{0, i}, i);
136 for (idx_t j = 0; j < i; ++j)
144 for (idx_t j = 0; j < i; ++j)
156 for (idx_t j = 0; j < i; ++j)
157 t[j] = -
tau[i] *
V(j, i);
181 T(
k - 1,
k - 1) =
tau[
k - 1];
184 for (idx_t i =
k - 2; i != idx_t(-1); --i) {
186 auto t = slice(T,
range{i + 1,
k}, i);
190 for (idx_t j = 0; j <
k - i - 1; ++j)
198 for (idx_t j = 0; j <
k - i - 1; ++j)
199 t[j] = -
tau[i] *
conj(
V(n -
k + i, j + i + 1));
208 for (idx_t j = 0; j <
k - i - 1; ++j)
209 t[j] = -
tau[i] *
V(j + i + 1, n -
k + i);
constexpr internal::LowerTriangle LOWER_TRIANGLE
Lower Triangle access.
Definition types.hpp:188
constexpr internal::UpperTriangle UPPER_TRIANGLE
Upper Triangle access.
Definition types.hpp:186
constexpr internal::NonUnitDiagonal NON_UNIT_DIAG
The main diagonal is not assumed to consist of 1's.
Definition types.hpp:220
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:264
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
#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_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
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
void gemv(Op trans, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, const beta_t &beta, vectorY_t &y)
General matrix-vector multiply:
Definition gemv.hpp:57
void trmv(Uplo uplo, Op trans, Diag diag, const matrixA_t &A, vectorX_t &x)
Triangular matrix-vector multiply:
Definition trmv.hpp:60
void gemm(Op transA, Op transB, const alpha_t &alpha, const matrixA_t &A, const matrixB_t &B, const beta_t &beta, matrixC_t &C)
General matrix-matrix multiply:
Definition gemm.hpp:61
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
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