75 using T = type_t<matrix_t>;
76 using real_t = real_type<T>;
77 using idx_t = size_type<matrix_t>;
78 using range = pair<idx_t, idx_t>;
83 const idx_t n = nrows(A);
94 const real_t a00 = real(A(0, 0));
102 "The leading minor of order 1 is not positive definite,"
103 " and the factorization could not be completed.");
110 const idx_t n1 = n / 2;
113 auto A11 = slice(A, range{0, n1}, range{0, n1});
114 auto A22 = slice(A, range{n1, n}, range{n1, n});
120 opts.ec.internal, info,
121 "The leading minor of the reported order is not positive "
123 " and the factorization could not be completed.");
127 if (uplo == Uplo::Upper) {
129 auto A12 = slice(A, range{0, n1}, range{n1, n});
130 trsm(LEFT_SIDE, Uplo::Upper, CONJ_TRANS, NON_UNIT_DIAG, one, A11,
134 herk(UPPER_TRIANGLE, CONJ_TRANS, -one, A12, one, A22);
138 auto A21 = slice(A, range{n1, n}, range{0, n1});
139 trsm(RIGHT_SIDE, Uplo::Lower, CONJ_TRANS, NON_UNIT_DIAG, one, A11,
143 herk(LOWER_TRIANGLE, NO_TRANS, -one, A21, one, A22);
152 opts.ec.internal, info + n1,
153 "The leading minor of the reported order is not positive "
155 " and the factorization could not be completed.");
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 trsm(Side side, Uplo uplo, Op trans, Diag diag, const alpha_t &alpha, const matrixA_t &A, matrixB_t &B)
Solve the triangular matrix-vector equation.
Definition trsm.hpp:76
int potrf2(uplo_t uplo, matrix_t &A, const EcOpts &opts={})
Computes the Cholesky factorization of a Hermitian positive definite matrix A using the recursive alg...
Definition potrf2.hpp:73
#define tlapack_error_if(cond, info, detailedInfo)
Error handler with conditional.
Definition exceptionHandling.hpp:171
#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