1#ifndef STAN_MATH_PRIM_FUN_COMPLEX_SCHUR_DECOMPOSE_HPP
2#define STAN_MATH_PRIM_FUN_COMPLEX_SCHUR_DECOMPOSE_HPP
27template <
typename M, require_eigen_dense_dynamic_t<M>* =
nullptr>
28inline Eigen::Matrix<complex_return_t<scalar_type_t<M>>, -1, -1>
34 using MatType = Eigen::Matrix<scalar_type_t<M>, -1, -1>;
36 Eigen::ComplexSchur<MatType> cs{MatType(m)};
51template <
typename M, require_eigen_dense_dynamic_t<M>* =
nullptr>
52inline Eigen::Matrix<complex_return_t<scalar_type_t<M>>, -1, -1>
58 using MatType = Eigen::Matrix<scalar_type_t<M>, -1, -1>;
60 Eigen::ComplexSchur<MatType> cs{MatType(m),
false};
80template <
typename M, require_eigen_dense_dynamic_t<M>* =
nullptr>
81inline std::tuple<Eigen::Matrix<complex_return_t<scalar_type_t<M>>, -1, -1>,
82 Eigen::Matrix<complex_return_t<scalar_type_t<M>>, -1, -1>>
85 return std::make_tuple(m, m);
88 using MatType = Eigen::Matrix<scalar_type_t<M>, -1, -1>;
90 Eigen::ComplexSchur<MatType> cs{MatType(m)};
91 return std::make_tuple(std::move(cs.matrixU()), std::move(cs.matrixT()));
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
std::tuple< Eigen::Matrix< complex_return_t< scalar_type_t< M > >, -1, -1 >, Eigen::Matrix< complex_return_t< scalar_type_t< M > >, -1, -1 > > complex_schur_decompose(const M &m)
Return the complex Schur decomposition of the specified square matrix.
Eigen::Matrix< complex_return_t< scalar_type_t< M > >, -1, -1 > complex_schur_decompose_u(const M &m)
Return the unitary matrix of the complex Schur decomposition of the specified square matrix.
Eigen::Matrix< complex_return_t< scalar_type_t< M > >, -1, -1 > complex_schur_decompose_t(const M &m)
Return the Schur form matrix of the complex Schur decomposition of the specified square matrix.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...