Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
eigenvalues_sym.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__MATRIX__EIGENVALUES_SYM_HPP
2 #define STAN__MATH__MATRIX__EIGENVALUES_SYM_HPP
3 
7 
8 namespace stan {
9  namespace math {
10 
20  template <typename T>
21  Eigen::Matrix<T,Eigen::Dynamic,1>
22  eigenvalues_sym(const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& m) {
23  stan::math::check_nonzero_size("eigenvalues_sym(%1%)",m,
24  "m",(double*)0);
25  stan::math::check_symmetric("eigenvalues_sym(%1%)",m,"m",(double*)0);
26 
27  Eigen::SelfAdjointEigenSolver<Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> >
28  solver(m,Eigen::EigenvaluesOnly);
29  return solver.eigenvalues();
30  }
31 
32  }
33 }
34 #endif
bool check_symmetric(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is symmetric.
Eigen::Matrix< T, Eigen::Dynamic, 1 > eigenvalues_sym(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Return the eigenvalues of the specified symmetric matrix in descending order of magnitude.
bool check_nonzero_size(const char *function, const T_y &y, const char *name, T_result *result)
Return true if the specified matrix/vector is of non-zero size.

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