Automatic Differentiation
 
Loading...
Searching...
No Matches
diag_post_multiply.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_DIAG_POST_MULTIPLY_HPP
2#define STAN_MATH_PRIM_FUN_DIAG_POST_MULTIPLY_HPP
3
6
7namespace stan {
8namespace math {
9
22template <typename T1, typename T2, require_eigen_t<T1>* = nullptr,
23 require_eigen_vector_t<T2>* = nullptr,
24 require_all_not_st_var<T1, T2>* = nullptr>
25auto diag_post_multiply(const T1& m1, const T2& m2) {
26 check_size_match("diag_post_multiply", "m2.size()", m2.size(), "m1.cols()",
27 m1.cols());
28 return m1 * m2.asDiagonal();
29}
30
31} // namespace math
32} // namespace stan
33#endif
auto diag_post_multiply(const T1 &m1, const T2 &m2)
Return the product of a matrix and the diagonal matrix formed from the vector or row_vector.
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 ...