Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
cholesky_decompose.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__MATRIX__CHOLESKY_DECOMPOSE_HPP__
2 #define __STAN__MATH__MATRIX__CHOLESKY_DECOMPOSE_HPP__
3 
6 
7 namespace stan {
8  namespace math {
9 
20  template <typename T>
21  Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>
22  cholesky_decompose(const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& m) {
23  validate_symmetric(m,"cholesky decomposition");
24  Eigen::LLT<Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> >llt(m.rows());
25  llt.compute(m);
26  return llt.matrixL();
27  }
28 
29  }
30 }
31 #endif

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