Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
math
matrix
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
4
#include <
stan/math/matrix/Eigen.hpp
>
5
#include <
stan/math/matrix/validate_symmetric.hpp
>
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.