1#ifndef STAN_MATH_FWD_FUN_TRACE_DOT_HPP
2#define STAN_MATH_FWD_FUN_TRACE_DOT_HPP
26template <
typename EigMat1,
typename EigMat2,
27 require_all_eigen_t<EigMat1, EigMat2>* =
nullptr,
28 require_any_vt_fvar<EigMat1, EigMat2>* =
nullptr>
32 return trace(
multiply(std::forward<EigMat1>(A), std::forward<EigMat2>(B)));
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
return_type_t< EigMat1, EigMat2 > trace_dot(EigMat1 &&A, EigMat2 &&B)
Compute the trace of the product of two matrices with forward-mode autodiff support.
value_type_t< T > trace(const T &m)
Calculates trace (sum of diagonal) of given kernel generator expression.
auto multiply(const Mat1 &m1, const Mat2 &m2)
Return the product of the specified matrices.
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...