Automatic Differentiation
 
Loading...
Searching...
No Matches
return_type.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_RETURN_TYPE_HPP
2#define STAN_MATH_PRIM_META_RETURN_TYPE_HPP
3
8#include <complex>
9#include <vector>
10
11namespace stan {
12
27template <typename... Ts>
29 using type = double;
30};
31
32template <typename T, typename... Ts>
33struct real_return<T, Ts...> {
34 using type
36};
37
45template <typename... Ts>
46using real_return_t = typename real_return<Ts...>::type;
47
56template <typename... Ts>
57using complex_return_t = std::complex<real_return_t<Ts...>>;
58
67template <typename... Ts>
68using std_vector_return_t = std::vector<real_return_t<Ts...>>;
69
79template <typename... Ts>
80using matrix_return_t = Eigen::Matrix<real_return_t<Ts...>, -1, -1>;
81
91template <typename... Ts>
92using vector_return_t = Eigen::Matrix<real_return_t<Ts...>, -1, 1>;
93
103template <typename... Ts>
104using row_vector_return_t = Eigen::Matrix<real_return_t<Ts...>, 1, -1>;
105
117template <typename T1, typename T2>
120};
121
122template <typename T1, typename T2>
123struct scalar_lub<std::complex<T1>, T2> {
124 using type = std::complex<promote_args_t<T1, T2>>;
125};
126
127template <typename T1, typename T2>
128struct scalar_lub<T1, std::complex<T2>> {
129 using type = std::complex<promote_args_t<T1, T2>>;
130};
131
132template <typename T1, typename T2>
133struct scalar_lub<std::complex<T1>, std::complex<T2>> {
134 using type = std::complex<promote_args_t<T1, T2>>;
135};
136
146template <typename T1, typename T2>
148
149namespace internal {
150template <typename... Ts>
152 using type = double;
153};
154
155template <typename T, typename... Ts>
156struct return_type_impl<T, Ts...> {
157 using type
159};
160
161template <typename... T, typename... Ts>
162struct return_type_impl<std::tuple<T...>, Ts...> {
164 typename return_type_impl<Ts...>::type>;
165};
166
167} // namespace internal
168
206template <typename... Ts>
207struct return_type : internal::return_type_impl<std::decay_t<Ts>...> {};
208
217template <typename... Ts>
218using return_type_t = typename return_type<Ts...>::type;
219
225template <template <class...> class Check, typename... Ts>
227
233template <template <class...> class Check, typename... Ts>
235
236} // namespace stan
237#endif
Eigen::Matrix< real_return_t< Ts... >, -1, 1 > vector_return_t
Convenience type to calculate the complex return type, which wraps Eigen::Matrix< ,...
Eigen::Matrix< real_return_t< Ts... >, 1, -1 > row_vector_return_t
Convenience type to calculate the complex return type, which wraps Eigen::Matrix< ,...
typename boost::math::tools::promote_args< Args... >::type promote_args_t
Convenience alias for boost tools promote_args.
std::vector< real_return_t< Ts... > > std_vector_return_t
Convenience type to calculate the complex return type, which wraps std::vector around the return type...
Eigen::Matrix< real_return_t< Ts... >, -1, -1 > matrix_return_t
Convenience type to calculate the complex return type, which wraps Eigen::Matrix< ,...
typename real_return< Ts... >::type real_return_t
Convenience type to calculate the real return type.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
typename scalar_lub< T1, T2 >::type scalar_lub_t
Convenience type for the least upper bound of the specified template parameters in Stan's assignment ...
std::complex< real_return_t< Ts... > > complex_return_t
Convenience type to calculate the complex return type, which wraps std::complex around the return typ...
std::enable_if_t<!Check::value > require_not_t
If condition is false, template is disabled.
require_t< Check< return_type_t< Ts... > > > require_return_type_t
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
require_not_t< Check< return_type_t< Ts... > > > require_not_return_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
STL namespace.
scalar_lub_t< scalar_type_t< T >, typename return_type_impl< Ts... >::type > type
scalar_lub_t< typename return_type_impl< T... >::type, typename return_type_impl< Ts... >::type > type
promote_args_t< base_type_t< T >, typename real_return< Ts... >::type > type
Provides a member type alias named type, the value of which is the least type under Stan's assignabil...
Template metaprogram to calculate the base scalar return type resulting from promoting all the scalar...
std::complex< promote_args_t< T1, T2 > > type
std::complex< promote_args_t< T1, T2 > > type
std::complex< promote_args_t< T1, T2 > > type
promote_args_t< T1, T2 > type
Defines a member type named type that is the least scalar type to which both template parameter scala...