Automatic Differentiation
 
Loading...
Searching...
No Matches
is_constant.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_IS_CONSTANT_HPP
2#define STAN_MATH_PRIM_META_IS_CONSTANT_HPP
3
12#include <type_traits>
13#include <vector>
14namespace stan {
15
29template <typename T, typename = void>
30struct is_constant : bool_constant<std::is_convertible<T, double>::value> {};
31
38template <typename... T>
40
41template <typename... T>
42inline constexpr bool is_constant_all_v
44
52template <typename T>
54 : bool_constant<is_constant<typename std::decay_t<T>::value_type>::value> {
55};
56
65template <typename T>
67 : bool_constant<is_constant<typename std::decay_t<T>::Scalar>::value> {};
68
69template <typename T>
70inline constexpr bool is_constant_v = is_constant<std::decay_t<T>>::value;
71
72} // namespace stan
73#endif
require_t< is_eigen< std::decay_t< T > > > require_eigen_t
Require type satisfies is_eigen.
Definition is_eigen.hpp:113
require_t< is_std_vector< std::decay_t< T > > > require_std_vector_t
Require type satisfies is_std_vector.
std::integral_constant< bool, B > bool_constant
Alias for structs used for wraps a static constant of bool.
constexpr bool is_constant_v
constexpr bool is_constant_all_v
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Metaprogramming struct to detect whether a given type is constant in the mathematical sense (not the ...
Extends std::true_type when instantiated with zero or more template parameters, all of which extend t...