Automatic Differentiation
 
Loading...
Searching...
No Matches
elt_multiply.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_ELT_MULTIPLY_HPP
2#define STAN_MATH_PRIM_FUN_ELT_MULTIPLY_HPP
3
8
9namespace stan {
10namespace math {
11
23template <typename Mat1, typename Mat2,
24 require_all_eigen_t<Mat1, Mat2>* = nullptr,
25 require_all_not_st_var<Mat1, Mat2>* = nullptr>
26auto elt_multiply(const Mat1& m1, const Mat2& m2) {
27 check_matching_dims("elt_multiply", "m1", m1, "m2", m2);
28 return m1.cwiseProduct(m2);
29}
30
42template <typename Scalar1, typename Scalar2,
44auto elt_multiply(const Scalar1& a, const Scalar2& b) {
45 return a * b;
46}
47
60template <typename T1, typename T2, require_any_matrix_t<T1, T2>* = nullptr,
61 require_any_stan_scalar_t<T1, T2>* = nullptr>
62inline auto elt_multiply(const T1& A, const T2& B) {
63 return multiply(A, B);
64}
65
66} // namespace math
67} // namespace stan
68
69#endif
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
require_all_t< is_stan_scalar< std::decay_t< Types > >... > require_all_stan_scalar_t
Require all of the types satisfy is_stan_scalar.
auto multiply(const Mat1 &m1, const Mat2 &m2)
Return the product of the specified matrices.
Definition multiply.hpp:18
void check_matching_dims(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the two containers have the same dimensions.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9