Stan Math Library
2.14.0
reverse mode automatic differentiation
stan
math
fwd
mat
fun
log_determinant.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_FWD_MAT_FUN_LOG_DETERMINANT_HPP
2
#define STAN_MATH_FWD_MAT_FUN_LOG_DETERMINANT_HPP
3
4
#include <
stan/math/prim/mat/fun/Eigen.hpp
>
5
#include <
stan/math/fwd/core.hpp
>
6
#include <
stan/math/fwd/mat/fun/typedefs.hpp
>
7
#include <
stan/math/fwd/mat/fun/determinant.hpp
>
8
#include <
stan/math/fwd/scal/fun/fabs.hpp
>
9
#include <
stan/math/fwd/scal/fun/log.hpp
>
10
#include <
stan/math/prim/mat/err/check_square.hpp
>
11
#include <boost/math/tools/promotion.hpp>
12
#include <vector>
13
14
namespace
stan
{
15
namespace
math {
16
17
template
<
typename
T,
int
R,
int
C>
18
inline
19
fvar<T>
20
log_determinant
(
const
Eigen::Matrix<
fvar<T>
, R, C>& m) {
21
check_square
(
"log_determinant"
,
"m"
, m);
22
23
return
log
(
fabs
(
determinant
(m)));
24
}
25
26
}
27
}
28
#endif
typedefs.hpp
core.hpp
stan::math::fabs
fvar< T > fabs(const fvar< T > &x)
Definition:
fabs.hpp:15
log.hpp
stan
Definition:
log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition:
log.hpp:14
fabs.hpp
stan::math::log_determinant
fvar< T > log_determinant(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition:
log_determinant.hpp:20
determinant.hpp
stan::math::determinant
fvar< T > determinant(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition:
determinant.hpp:21
Eigen.hpp
stan::math::check_square
void check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Check if the specified matrix is square.
Definition:
check_square.hpp:27
stan::math::fvar
Definition:
fvar.hpp:14
check_square.hpp
[
Stan Home Page
]
© 2011–2016, Stan Development Team.