Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
agrad
fwd
matrix
log_determinant.hpp
Go to the documentation of this file.
1
#ifndef STAN__AGRAD__FWD__MATRIX__LOG_DETERMINANT_HPP
2
#define STAN__AGRAD__FWD__MATRIX__LOG_DETERMINANT_HPP
3
4
#include <vector>
5
#include <boost/math/tools/promotion.hpp>
6
#include <
stan/math/matrix/Eigen.hpp
>
7
#include <
stan/agrad/fwd/fvar.hpp
>
8
#include <
stan/agrad/fwd/matrix/typedefs.hpp
>
9
#include <
stan/agrad/fwd/matrix/determinant.hpp
>
10
#include <
stan/agrad/fwd/functions/fabs.hpp
>
11
#include <
stan/agrad/fwd/functions/log.hpp
>
12
#include <
stan/math/error_handling/matrix/check_square.hpp
>
13
14
namespace
stan {
15
namespace
agrad {
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
stan::math::check_square
(
"log_determinant(%1%)"
,m,
"m"
,(
double
*)0);
22
23
return
stan::agrad::log
(
stan::agrad::fabs
(
stan::agrad::determinant
(m)));
24
}
25
}
26
}
27
#endif
stan::agrad::fabs
fvar< T > fabs(const fvar< T > &x)
Definition:
fabs.hpp:18
stan::agrad::fvar
Definition:
fvar.hpp:13
log.hpp
typedefs.hpp
fvar.hpp
determinant.hpp
Eigen.hpp
stan::agrad::log
fvar< T > log(const fvar< T > &x)
Definition:
log.hpp:15
stan::agrad::determinant
fvar< T > determinant(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition:
determinant.hpp:21
stan::agrad::log_determinant
fvar< T > log_determinant(const Eigen::Matrix< fvar< T >, R, C > &m)
Definition:
log_determinant.hpp:20
stan::math::check_square
bool check_square(const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result)
Return true if the specified matrix is square.
Definition:
check_square.hpp:24
fabs.hpp
check_square.hpp
[
Stan Home Page
]
© 2011–2014, Stan Development Team.