43 using idx_t = size_type<matrix_t>;
44 using T = type_t<matrix_t>;
45 using real_t = real_type<T>;
46 using range = pair<idx_t, idx_t>;
48 const idx_t n = nrows(U);
56 for (idx_t j = n; j-- > 0;) {
59 real(U(j, j)) * real(U(j, j)) + imag(U(j, j)) * imag(U(j, j));
60 for (idx_t k = 0; k < j; ++k) {
61 real_part_of_ujj += real(U(k, j)) * real(U(k, j)) +
62 imag(U(k, j)) * imag(U(k, j));
64 U(j, j) = real_part_of_ujj;
65 for (idx_t i = j; i-- > 0;) {
66 U(i, j) =
conj(U(i, i)) * U(i, j);
67 for (idx_t k = i; k-- > 0;) {
68 U(i, j) +=
conj(U(k, i)) * U(k, j);
75 const idx_t n0 = n / 2;
77 auto U00 = slice(U, range(0, n0), range(0, n0));
78 auto U01 = slice(U, range(0, n0), range(n0, n));
79 auto U11 = slice(U, range(n0, n), range(n0, n));
85 herk(Uplo::Upper, Op::ConjTrans, real_t(1), U01, real_t(1), U11);
88 trmm(Side::Left, Uplo::Upper, Op::ConjTrans, Diag::NonUnit, real_t(1), U00,
void mult_uhu(matrix_t &U, const mult_uhu_Opts &opts={})
in-place multiplication of upper triangular matrix U and lower triangular matrix U^H.
Definition mult_uhu.hpp:41
void herk(Uplo uplo, Op trans, const alpha_t &alpha, const matrixA_t &A, const beta_t &beta, matrixC_t &C)
Hermitian rank-k update:
Definition herk.hpp:68
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
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
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