12#ifndef TLAPACK_HETF3_HH
13#define TLAPACK_HETF3_HH
31 Op invariant = Op::Trans;
70 const idx_t n = nrows(
A);
71 const idx_t nb =
opts.nb;
81 opts.invariant == Op::ConjTrans);
90 constexpr auto copy_ = [](
auto&&
x,
auto&&
y) {
94 auto&&
beta,
auto&&
y) {
97 constexpr auto swap_ = [](
auto&&
x,
auto&&
y) {
100 constexpr auto rscl_ = [](
auto&&
alpha,
auto&&
x) {
106 auto conjv = [](
auto&&
x) {
107 const idx_t n = size(
x);
108 for (
int i = 0; i < n; ++i)
113 if (
uplo == Uplo::Upper) {
118 int jn = min((
int)nb, (
int)n);
123 for (
s = n - 1;
s > (
int)(n)-
jn; --
s) {
181 slice(
W,
range{j + 1, n},
jW - 1), T(1),
250 slice(
A,
range{0, j}, j));
269 T
d = T(1) / (
D11 *
D22 - T(1));
272 for (
int k = 0;
k <
s; ++
k) {
278 A(j - 1, j) =
W(j - 1,
jW);
279 A(j - 1, j - 1) =
W(j - 1,
jW - 1);
293 if (
s >= (
int)n -
jn) {
316 for (
int j =
s + 1; j < n; ++j) {
325 if ((
piv !=
s) & (j + 1 < n)) {
341 for (
s = 0;
s <
jn - 1; ++
s) {
353 slice(
W,
range{0, j}, j), T(1), col(
Wj0, j));
358 slice(
W, j,
range{0, j}), T(1), col(
Wj0, j));
386 slice(
W,
range{0, j}, j + 1));
389 slice(
W,
range{0, j}, j + 1), T(1),
438 slice(
A,
range{j + 1, n}, j));
449 T
d = T(1) / (
D11 *
D22 - T(1));
452 for (
int k = j + 2;
k < n; ++
k) {
458 A(j + 1, j) =
W(j + 1, j);
459 A(j + 1, j + 1) =
W(j + 1, j + 1);
483 for (
int j =
s - 1; j > 0; --j) {
490 if ((
piv !=
s) && (j > 0)) {
Op
Definition types.hpp:227
constexpr internal::NoTranspose NO_TRANS
no transpose
Definition types.hpp:260
constexpr real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
constexpr real_type< T > abs1(const T &x)
1-norm absolute value, |Re(x)| + |Im(x)|
Definition utils.hpp:133
#define TLAPACK_UPLO
Macro for tlapack::concepts::Uplo compatible with C++17.
Definition concepts.hpp:942
#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
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
void rscl(const alpha_t &alpha, vector_t &x)
Scale vector by the reciprocal of a constant, .
Definition rscl.hpp:22
void copy(const vectorX_t &x, vectorY_t &y)
Copy vector, .
Definition copy.hpp:31
void swap(vectorX_t &x, vectorY_t &y)
Swap vectors, .
Definition swap.hpp:31
size_type< vector_t > iamax(const vector_t &x, const IamaxOpts< abs_f > &opts)
Return .
Definition iamax.hpp:234
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 syr2k(Uplo uplo, Op trans, const alpha_t &alpha, const matrixA_t &A, const matrixB_t &B, const beta_t &beta, matrixC_t &C)
Symmetric rank-k update:
Definition syr2k.hpp:64
void her2k(Uplo uplo, Op trans, const alpha_t &alpha, const matrixA_t &A, const matrixB_t &B, const beta_t &beta, matrixC_t &C)
Hermitian rank-k update:
Definition her2k.hpp:72
int hetf3(uplo_t uplo, matrix_t &A, ipiv_t &ipiv, work_t &work, const BlockedLDLOpts &opts)
Computes the partial factorization of a symmetric or Hermitian matrix A using the Bunch-Kaufman diago...
Definition hetf3.hpp:58
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
Computes the Bunch-Kaufman factorization of a symmetric or Hermitian matrix A using a blocked algorit...
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
Options struct for hetrf_blocked()
Definition hetf3.hpp:27
size_t nb
Block size.
Definition hetf3.hpp:30
Options for error checking.
Definition exceptionHandling.hpp:76