Stan Math Library  2.20.0
reverse mode automatic differentiation
singular_values.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_SINGULAR_VALUES_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_SINGULAR_VALUES_HPP
3 
5 
6 namespace stan {
7 namespace math {
8 
17 template <typename T>
18 Eigen::Matrix<T, Eigen::Dynamic, 1> singular_values(
19  const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& m) {
20  return Eigen::JacobiSVD<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> >(m)
21  .singularValues();
22 }
23 
24 } // namespace math
25 } // namespace stan
26 #endif
Eigen::Matrix< T, Eigen::Dynamic, 1 > singular_values(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Return the vector of the singular values of the specified matrix in decreasing order of magnitude...

     [ Stan Home Page ] © 2011–2018, Stan Development Team.