Automatic Differentiation
 
Loading...
Searching...
No Matches
LDLT_factor.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_LDLT_FACTOR_HPP
2#define STAN_MATH_PRIM_FUN_LDLT_FACTOR_HPP
3
9#include <memory>
10
11namespace stan {
12namespace math {
13
20template <typename T, typename Enable = void>
22
29template <typename T>
30class LDLT_factor<T, std::enable_if_t<bool_constant<
31 is_eigen_matrix_dynamic<T>::value
32 && !is_var<scalar_type_t<T>>::value>::value>> {
33 private:
35 Eigen::LDLT<plain_type_t<T>> ldlt_;
36
37 public:
38 template <typename S,
40 explicit LDLT_factor(const S& matrix)
41 : matrix_(matrix), ldlt_(matrix_.ldlt()) {}
42
46 const auto& matrix() const { return matrix_; }
47
51 const auto& ldlt() const { return ldlt_; }
52};
53
61template <typename T, require_matrix_t<T>* = nullptr>
62inline auto make_ldlt_factor(const T& A) {
64}
65
66} // namespace math
67} // namespace stan
68
69#endif
LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values.
require_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_same_t
Require types T and S satisfies std::is_same.
auto make_ldlt_factor(const T &A)
Make an LDLT_factor with matrix type plain_type_t<T>
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.