Stan Math Library
2.8.0
reverse mode automatic differentiation
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Groups
stan
math
prim
mat
fun
trace.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_MAT_FUN_TRACE_HPP
2
#define STAN_MATH_PRIM_MAT_FUN_TRACE_HPP
3
4
#include <
stan/math/prim/mat/fun/Eigen.hpp
>
5
6
7
namespace
stan {
8
namespace
math {
9
19
template
<
typename
T>
20
inline
T
trace
(
const
Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& m) {
21
return
m.trace();
22
}
23
24
template
<
typename
T>
25
inline
T
26
trace
(
const
T& m) {
27
return
m;
28
}
29
}
30
}
31
#endif
Eigen.hpp
stan::math::trace
T trace(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
Returns the trace of the specified matrix.
Definition:
trace.hpp:20
[
Stan Home Page
]
© 2011–2015, Stan Development Team.