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

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

eigenvectors_sym.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_EIGENVECTORS_SYM_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_EIGENVECTORS_SYM_HPP
3
4 #include <stan/math/prim/arr/err/check_nonzero_size.hpp>
5 #include <stan/math/prim/mat/err/check_symmetric.hpp>
6 #include <stan/math/prim/mat/fun/Eigen.hpp>
7
8 namespace stan {
9 namespace math {
10
11 template <typename T>
12 Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
13 eigenvectors_sym(const Eigen::Matrix
14 <T, Eigen::Dynamic, Eigen::Dynamic>& m) {
15 stan::math::check_nonzero_size("eigenvectors_sym", "m", m);
16 stan::math::check_symmetric("eigenvalues_sym", "m", m);
17
18 Eigen::SelfAdjointEigenSolver
19 <Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> >
20 solver(m);
21 return solver.eigenvectors();
22 }
23
24 }
25 }
26 #endif
stan
Definition: log_sum_exp.hpp:8
check_symmetric.hpp
stan::math::check_nonzero_size
bool check_nonzero_size(const char *function, const char *name, const T_y &y)
Return true if the specified matrix/vector is of non-zero size.
Definition: check_nonzero_size.hpp:30
Eigen.hpp
stan::math::check_symmetric
bool check_symmetric(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is symmetric.
Definition: check_symmetric.hpp:37
stan::math::eigenvectors_sym
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > eigenvectors_sym(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Definition: eigenvectors_sym.hpp:13
check_nonzero_size.hpp

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