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
math
matrix
trace.hpp
Go to the documentation of this file.
1
#ifndef STAN__MATH__MATRIX__TRACE_HPP
2
#define STAN__MATH__MATRIX__TRACE_HPP
3
4
#include <
stan/math/matrix/Eigen.hpp
>
5
#include <
stan/meta/traits.hpp
>
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
traits.hpp
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–2014, Stan Development Team.