Stan Math Library: stan/math/prim/mat/fun/singular_values.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 // NOTE: if using this with rev mode, include numeric_limits
5 // or else this seg-faults.
6 #include <stan/math/prim/mat/fun/Eigen.hpp>
7
8 namespace stan {
9 namespace math {
10
19 template <typename T>
20 Eigen::Matrix<T, Eigen::Dynamic, 1>
21 singular_values(const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& m) {
22 return Eigen::JacobiSVD
23 <Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> >(m).singularValues();
24 }
25
26 }
27 }
28 #endif
stan
Definition: log_sum_exp.hpp:8
stan::math::singular_values
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...
Definition: singular_values.hpp:21
Eigen.hpp

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