1#ifndef STAN_MATH_FWD_FUN_MULTIPLY_HPP
2#define STAN_MATH_FWD_FUN_MULTIPLY_HPP
16template <
typename Mat1,
typename Mat2,
17 require_all_eigen_vt<is_fvar, Mat1, Mat2>* =
nullptr,
18 require_vt_same<Mat1, Mat2>* =
nullptr,
19 require_not_eigen_row_and_col_t<Mat1, Mat2>* =
nullptr>
22 decltype(
auto) m1_ref =
to_ref(m1);
23 decltype(
auto) m2_ref =
to_ref(m2);
26 multiply(m1_ref.d(), m2_ref.val())));
29template <
typename Mat1,
typename Mat2,
33inline auto multiply(Mat1&& m1, Mat2&& m2) {
35 decltype(
auto) m1_ref =
to_ref(m1);
36 decltype(
auto) m2_ref =
to_ref(m2);
40template <
typename Mat1,
typename Mat2,
41 require_eigen_vt<std::is_floating_point, Mat1>* =
nullptr,
42 require_eigen_vt<is_fvar, Mat2>* =
nullptr,
43 require_not_eigen_row_and_col_t<Mat1, Mat2>* =
nullptr>
44inline auto multiply(Mat1&& m1, Mat2&& m2) {
46 decltype(
auto) m1_ref =
to_ref(m1);
47 decltype(
auto) m2_ref =
to_ref(m2);
require_t< container_type_check_base< is_eigen, value_type_t, TypeCheck, Check... > > require_eigen_vt
Require type satisfies is_eigen.
addition_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > add(T_a &&a, T_b &&b)
auto multiply(Mat1 &&m1, Mat2 &&m2)
Return the product of the specified matrices.
void check_multiplicable(const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
Check if the matrices can be multiplied.
fvar< T > to_fvar(const T &x)
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
require_not_t< math::conjunction< is_eigen_row_vector< Row >, is_eigen_col_vector< Col > > > require_not_eigen_row_and_col_t
Require Row is not a row vector and Col is not a column vector.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...