1#ifndef STAN_MATH_PRIM_META_FORWARD_AS_HPP
2#define STAN_MATH_PRIM_META_FORWARD_AS_HPP
11template <
typename T1,
typename T2>
13 return static_cast<int>(desired) == Eigen::Dynamic
14 ||
static_cast<int>(desired) ==
static_cast<int>(actual);
32template <
typename T_desired,
typename T_actual,
34 = std::enable_if_t<std::is_same<std::decay_t<T_actual>,
35 std::decay_t<T_desired>>::value
38 return std::forward<T_actual>(a);
57template <
typename T_desired,
typename T_actual,
58 typename = std::enable_if_t<
59 !std::is_same<std::decay<T_actual>, std::decay<T_desired>>::value
62 throw std::runtime_error(
"Wrong type assumed! Please file a bug report.");
80 typename T_desired,
typename T_actual,
86 T_desired::RowsAtCompileTime,
87 std::decay_t<T_actual>::RowsAtCompileTime)
89 T_desired::ColsAtCompileTime,
90 std::decay_t<T_actual>::ColsAtCompileTime)>* =
nullptr>
92 return std::forward<T_actual>(a);
112 typename T_desired,
typename T_actual,
117 T_desired::RowsAtCompileTime,
118 std::decay_t<T_actual>::RowsAtCompileTime)
120 T_desired::ColsAtCompileTime,
121 std::decay_t<T_actual>::ColsAtCompileTime)>* =
nullptr>
123 throw std::runtime_error(
"Wrong type assumed! Please file a bug report.");
require_all_t< is_eigen< std::decay_t< Types > >... > require_all_eigen_t
Require all of the types satisfy is_eigen.
require_t< is_eigen< std::decay_t< T > > > require_eigen_t
Require type satisfies is_eigen.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
T_actual && forward_as(T_actual &&a)
Assume which type we get.
constexpr bool eigen_static_size_match(T1 desired, T2 actual)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Check if type derives from EigenBase