Automatic Differentiation
 
Loading...
Searching...
No Matches
trace.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_TRACE_HPP
2#define STAN_MATH_PRIM_FUN_TRACE_HPP
3
6
7namespace stan {
8namespace math {
9
20template <typename T, require_eigen_t<T>* = nullptr,
21 require_not_st_var<T>* = nullptr>
22inline auto trace(T&& m) {
23 return make_holder([](auto&& m_) { return m_.trace(); }, std::forward<T>(m));
24}
25
26} // namespace math
27} // namespace stan
28
29#endif
value_type_t< T > trace(const T &m)
Calculates trace (sum of diagonal) of given kernel generator expression.
Definition trace.hpp:22
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
Definition holder.hpp:437
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...