12#ifndef TLAPACK_GEHRD_HH
13#define TLAPACK_GEHRD_HH
51template <
class T, TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
62 const idx_t n = ncols(
A);
115 const idx_t n = ncols(
A);
120 const idx_t nx = max(nb, (idx_t)
opts.nx_switch);
129 if (n <= 0)
return 0;
133 ? reshape(
work, n, nb)
134 : reshape(
work, 0, 0);
135 auto Yt = transpose_view(
Y);
137 ? reshape(
work2, nb, nb)
138 : reshape(
work2, 0, 0);
142 for (; i + nx <
ihi - 1; i = i + nb) {
143 const idx_t
nb2 = min(nb,
ihi - i - 1);
168 for (idx_t j = 0; j <
nb2 - 1; ++j) {
169 auto A4 = slice(
A,
range{0, i + 1}, i + j + 1);
221template <TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
236 const idx_t n = ncols(
A);
239 if (n <= 0)
return 0;
243 std::vector<T>
work_;
#define TLAPACK_SVECTOR
Macro for tlapack::concepts::SliceableVector compatible with C++17.
Definition concepts.hpp:909
#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
int gehrd(size_type< matrix_t > ilo, size_type< matrix_t > ihi, matrix_t &A, vector_t &tau, const GehrdOpts &opts={})
Reduces a general square matrix to upper Hessenberg form.
Definition gehrd.hpp:222
void transpose(matrixA_t &A, matrixB_t &B, const TransposeOpts &opts={})
transpose a matrix A into a matrix B.
Definition transpose.hpp:92
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 lahr2(size_type< matrix_t > k, size_type< matrix_t > nb, matrix_t &A, vector_t &tau, matrixT_t &T, matrixY_t &Y)
Reduces a general square matrix to upper Hessenberg form.
Definition lahr2.hpp:61
void axpy(const alpha_t &alpha, const vectorX_t &x, vectorY_t &y)
Add scaled vector, .
Definition axpy.hpp:34
void trmm(Side side, Uplo uplo, Op trans, Diag diag, const alpha_t &alpha, const matrixA_t &A, matrixB_t &B)
Triangular matrix-matrix multiply:
Definition trmm.hpp:72
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
int gehrd_work(size_type< matrix_t > ilo, size_type< matrix_t > ihi, matrix_t &A, vector_t &tau, work_t &work, const GehrdOpts &opts={})
Reduces a general square matrix to upper Hessenberg form. Workspace is provided as an argument.
Definition gehrd.hpp:99
int gehd2_work(size_type< matrix_t > ilo, size_type< matrix_t > ihi, matrix_t &A, vector_t &tau, work_t &work)
Reduces a general square matrix to upper Hessenberg form. Workspace is provided as an argument.
Definition gehd2.hpp:76
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
constexpr WorkInfo gehrd_worksize(size_type< matrix_t > ilo, size_type< matrix_t > ihi, const matrix_t &A, const vector_t &tau, const GehrdOpts &opts={})
Worspace query of gehrd()
Definition gehrd.hpp:52
Applies a Householder block reflector to a matrix.
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::LowerTriangle LOWER_TRIANGLE
Lower Triangle access.
Definition types.hpp:188
constexpr internal::RightSide RIGHT_SIDE
right side
Definition types.hpp:296
constexpr internal::Forward FORWARD
Forward direction.
Definition types.hpp:381
constexpr internal::UnitDiagonal UNIT_DIAG
The main diagonal is assumed to consist of 1's.
Definition types.hpp:222
constexpr internal::GeneralAccess GENERAL
General access.
Definition types.hpp:180
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:264
constexpr internal::ColumnwiseStorage COLUMNWISE_STORAGE
Columnwise storage.
Definition types.hpp:414
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 gehrd.
Definition gehrd.hpp:27
size_t nb
Block size used in the blocked reduction.
Definition gehrd.hpp:28
size_t nx_switch
If only nx_switch columns are left, the algorithm will use unblocked code.
Definition gehrd.hpp:29
Output information in the workspace query.
Definition workspace.hpp:16