11#ifndef TLAPACK_PTTRF_HH
12#define TLAPACK_PTTRF_HH
48 enable_if_t<is_same_v<real_type<type_t<d_t>>, real_type<type_t<e_t>>>,
52 using T = type_t<d_t>;
53 using real_t = real_type<T>;
54 using idx_t = size_type<d_t>;
56 const idx_t n = size(D);
61 for (idx_t i = 0; i < n - 1; ++i) {
62 if (real(D[i]) <= real_t(0)) {
64 opts.ec.internal, i + 1,
65 "The leading minor of the reported order is not positive "
67 " and the factorization could not be completed.");
71 E[i] = Ei /
real(D[i]);
74 if (
real(D[n - 1]) <= real_t(0)) {
77 "The leading minor of the highest order is not positive "
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
#define tlapack_error_if(cond, info, detailedInfo)
Error handler with conditional.
Definition exceptionHandling.hpp:171
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
int pttrf(d_t &D, e_t &E, const EcOpts &opts={})
Computes the Cholesky factorization of a Hermitian positive definite tridiagonal matrix A.
Definition pttrf.hpp:50
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 for error checking.
Definition exceptionHandling.hpp:76