1#ifndef STAN_MATH_PRIM_FUN_TRACE_DOT_HPP
2#define STAN_MATH_PRIM_FUN_TRACE_DOT_HPP
28template <
typename EigMat1,
typename EigMat2,
29 require_all_eigen_vt<std::is_arithmetic, EigMat1, EigMat2>* =
nullptr>
34 [](
auto&& A_,
auto&& B_) {
35 return A_.cwiseProduct(B_.transpose()).sum();
37 std::forward<EigMat1>(A), std::forward<EigMat2>(B));
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.
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
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 ...