1#ifndef STAN_MATH_PRIM_FUN_SVD_HPP
2#define STAN_MATH_PRIM_FUN_SVD_HPP
19template <
typename EigMat, require_eigen_matrix_dynamic_t<EigMat>* =
nullptr,
20 require_not_st_var<EigMat>* =
nullptr>
21std::tuple<Eigen::Matrix<value_type_t<EigMat>, -1, -1>,
22 Eigen::Matrix<base_type_t<EigMat>, -1, 1>,
23 Eigen::Matrix<value_type_t<EigMat>, -1, -1>>
31 Eigen::JacobiSVD<Eigen::Matrix<value_type_t<EigMat>, -1, -1>>
svd(
32 m, Eigen::ComputeThinU | Eigen::ComputeThinV);
33 return std::make_tuple(std::move(
svd.matrixU()),
34 std::move(
svd.singularValues()),
35 std::move(
svd.matrixV()));
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
std::tuple< Eigen::Matrix< value_type_t< EigMat >, -1, -1 >, Eigen::Matrix< base_type_t< EigMat >, -1, 1 >, Eigen::Matrix< value_type_t< EigMat >, -1, -1 > > svd(const EigMat &m)
Given input matrix m, return the singular value decomposition (U,D,V) such that m = U*diag(D)*V^{T}
typename base_type< T >::type base_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...