Stan Math Library  2.20.0
reverse mode automatic differentiation
log_determinant.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_LOG_DETERMINANT_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_LOG_DETERMINANT_HPP
3 
6 
7 namespace stan {
8 namespace math {
9 
17 template <typename T, int R, int C>
18 inline T log_determinant(const Eigen::Matrix<T, R, C>& m) {
19  check_square("log_determinant", "m", m);
20  return m.colPivHouseholderQr().logAbsDeterminant();
21 }
22 
23 } // namespace math
24 } // namespace stan
25 #endif
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
fvar< T > log_determinant(const Eigen::Matrix< fvar< T >, R, C > &m)

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