Automatic Differentiation
 
Loading...
Searching...
No Matches
is_complex.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_IS_COMPLEX_HPP
2#define STAN_MATH_PRIM_META_IS_COMPLEX_HPP
3
7
8#include <complex>
9#include <type_traits>
10
11namespace stan {
12namespace internal {
13
21template <typename T>
22struct is_complex_impl : std::false_type {};
23
24template <typename... Ts>
25struct is_complex_impl<std::complex<Ts...>> : std::true_type {};
26
27} // namespace internal
28
38template <typename T, typename = void>
39struct is_complex : std::false_type {};
40
41template <typename T>
43 T, std::enable_if_t<internal::is_complex_impl<std::decay_t<T>>::value>>
44 : std::true_type {};
45
53template <typename T>
54struct scalar_type<T, std::enable_if_t<is_complex<T>::value>> {
55 using type = std::complex<typename std::decay_t<T>::value_type>;
56};
57
65template <typename T>
67
70template <typename T>
72
75template <typename... Types>
77
80template <typename... Types>
82
85template <typename... Types>
96template <typename T>
98
101template <typename T>
104
107template <typename T>
121template <typename T>
122struct is_vt_complex : is_complex<value_type_t<std::decay_t<T>>> {};
123
133template <typename T>
135 : bool_constant<!is_complex<value_type_t<std::decay_t<T>>>::value> {};
136
137} // namespace stan
138
139#endif
require_all_t< is_complex< std::decay_t< Types > >... > require_all_complex_t
Require all of the types satisfy is_complex.
require_not_t< is_complex< std::decay_t< T > > > require_not_complex_t
Require type does not satisfy is_complex.
require_all_not_t< is_complex< std::decay_t< Types > >... > require_all_not_complex_t
Require none of the types satisfy is_complex.
require_not_t< is_complex< value_type_t< std::decay_t< T > > > > require_not_vt_complex
Require value type does not satisfy is_complex.
require_t< is_complex< std::decay_t< T > > > require_complex_t
Require type satisfies is_complex.
require_any_t< is_complex< std::decay_t< Types > >... > require_any_complex_t
Require any of the types satisfy is_complex.
require_t< is_complex< value_type_t< std::decay_t< T > > > > require_vt_complex
Require value type satisfies is_complex.
require_not_t< is_complex< scalar_type_t< std::decay_t< T > > > > require_not_st_complex
Require scalar type does not satisfy is_complex.
std::enable_if_t<!Check::value > require_not_t
If condition is false, template is disabled.
std::enable_if_t< math::disjunction< Checks... >::value > require_any_t
If any condition is true, template is enabled.
std::enable_if_t<!math::disjunction< Checks... >::value > require_all_not_t
If all conditions are false, template is enabled.
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
std::enable_if_t< math::conjunction< Checks... >::value > require_all_t
If all conditions are true, template is enabled Returns a type void if all conditions are true and ot...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
Provides a member constant value which is equal to true if T is an instance of std::complex and false...
If T is an arithmetic type (that is, an instance of std::complex) or a cv-qualified version thereof,...
If the value_type of the type T is of type std::complex or a cv-qualified version thereof,...
If the value_type of the type T is not of type std::complex or a cv-qualified version thereof,...
std::complex< typename std::decay_t< T >::value_type > type
Metaprogram structure to determine the base scalar type of a template argument.