Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
is_all_arithmetic.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_IS_ALL_ARITHMETIC_HPP
2#define STAN_MATH_PRIM_META_IS_ALL_ARITHMETIC_HPP
3
5#include <type_traits>
6#include <tuple>
7
8namespace stan {
9template <typename T>
10using is_arithmetic = std::is_arithmetic<scalar_type_t<T>>;
11
12template <typename T>
13inline constexpr bool is_arithmetic_v = is_arithmetic<std::decay_t<T>>::value;
14
15namespace internal {
16
17template <typename... Types>
19 : std::conjunction<is_arithmetic<std::decay_t<Types>>...> {};
20
21template <typename... Types>
22struct is_all_arithmetic_scalar_impl<std::tuple<Types...>>
23 : std::conjunction<is_all_arithmetic_scalar_impl<std::decay_t<Types>>...> {
24};
25template <typename T, typename... VecArgs>
26struct is_all_arithmetic_scalar_impl<std::vector<T, VecArgs...>>
27 : std::conjunction<is_all_arithmetic_scalar_impl<std::decay_t<T>>> {};
28} // namespace internal
29
30template <typename... Types>
32 : std::conjunction<
33 internal::is_all_arithmetic_scalar_impl<std::decay_t<Types>>...> {};
34
35template <typename... Types>
36inline constexpr bool is_all_arithmetic_scalar_v
38
39} // namespace stan
40
41#endif
constexpr bool is_all_arithmetic_scalar_v
std::is_arithmetic< scalar_type_t< T > > is_arithmetic
constexpr bool is_arithmetic_v
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.