12#ifndef TLAPACK_GEBRD_HH
13#define TLAPACK_GEBRD_HH
46template <
class T, TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
55 const idx_t m = nrows(
A);
56 const idx_t n = ncols(
A);
57 const idx_t nb = min((idx_t)
opts.nb, min(m, n));
60 return WorkInfo(m + n, nb);
90 const idx_t m = nrows(
A);
91 const idx_t n = ncols(
A);
92 const idx_t
k = min(m, n);
93 const idx_t nb = min((idx_t)
opts.nb,
k);
101 for (idx_t i = 0; i <
k; i = i + nb) {
102 idx_t
ib = min(nb,
k - i);
117 if (i +
ib < m && i +
ib < n) {
138 A(i +
ib - 1, i +
ib) =
e;
140 A(i +
ib, i +
ib - 1) =
e;
201template <TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR vector_t>
215 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 gebrd(matrix_t &A, vector_t &tauv, vector_t &tauw, const GebrdOpts &opts={})
Reduces a general m by n matrix A to an upper real bidiagonal form B by a unitary transformation:
Definition gebrd.hpp:202
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 labrd(A_t &A, vector_t &tauq, vector_t &taup, X_t &X, matrixY_t &Y)
Reduces the first nb rows and columns of a general m by n matrix A to upper or lower bidiagonal form ...
Definition labrd.hpp:55
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 gebrd_work(matrix_t &A, vector_t &tauv, vector_t &tauw, work_t &work, const GebrdOpts &opts={})
Reduces a general m by n matrix A to an upper real bidiagonal form B by a unitary transformation: W...
Definition gebrd.hpp:76
constexpr WorkInfo gebrd_worksize(const matrix_t &A, const vector_t &tauq, const vector_t &taup, const GebrdOpts &opts={})
Worspace query of gebrd()
Definition gebrd.hpp:47
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 real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
constexpr internal::GeneralAccess GENERAL
General access.
Definition types.hpp:180
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:264
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
Options struct for gebrd()
Definition gebrd.hpp:24
size_t nb
Block size used in the blocked reduction.
Definition gebrd.hpp:25
Output information in the workspace query.
Definition workspace.hpp:16