1 #ifndef STAN_MATH_PRIM_FUN_IDENTITY_CONSTRAIN_HPP
2 #define STAN_MATH_PRIM_FUN_IDENTITY_CONSTRAIN_HPP
3 
4 #include <stan/math/prim/meta.hpp>
5 
6 namespace stan {
7 namespace math {
8 
9 /**
10  * Returns the result of applying the identity constraint
11  * transform to the input. This promotes the input to the least upper
12  * bound of the input types.
13  *
14  * @tparam Jacobian if `true`, increment log density accumulator with log
15  * absolute Jacobian determinant of constraining transform
16  * @tparam T type of value to promote
17  * @tparam Types Other types.
18  * @param[in] x object
19  * @return transformed input
20  */
21 template <bool Jacobian = false, typename T, typename... Types,
22           require_all_not_var_matrix_t<T, Types...>* = nullptr>
identity_constrain(T && x,Types &&...)23 inline auto identity_constrain(T&& x, Types&&... /* args */) {
24   return promote_scalar_t<return_type_t<T, Types...>, T>(x);
25 }
26 
27 }  // namespace math
28 }  // namespace stan
29 
30 #endif
31