Automatic Differentiation
 
Loading...
Searching...
No Matches
require_generics.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_REQUIRE_GENERICS_HPP
2#define STAN_MATH_PRIM_META_REQUIRE_GENERICS_HPP
3
5#include <type_traits>
6
7namespace stan {
8
15template <typename T, typename S>
17 = require_t<std::is_same<std::decay_t<T>, std::decay_t<S>>>;
18
20template <typename T, typename S>
23
25template <typename T, typename... Types>
27 = require_all_t<std::is_same<std::decay_t<T>, std::decay_t<Types>>...>;
28
30template <typename T, typename... Types>
32 = require_any_t<std::is_same<std::decay_t<T>, std::decay_t<Types>>...>;
33
35template <typename T, typename... Types>
37 = require_all_not_t<std::is_same<std::decay_t<T>, std::decay_t<Types>>...>;
38
40template <typename T, typename... Types>
42 = require_any_not_t<std::is_same<std::decay_t<T>, std::decay_t<Types>>...>;
50template <typename T, typename S>
53
55template <typename T, typename S>
59
62template <typename T, typename... Types>
66
69template <typename T, typename... Types>
73
75template <typename T, typename S>
77 std::is_same<value_type_t<std::decay_t<T>>, value_type_t<std::decay_t<S>>>>;
78
80template <typename T, typename... Types>
92template <typename T, typename S>
95
97template <typename T, typename S>
100
102template <typename T, typename... Types>
104 std::is_convertible<std::decay_t<T>, std::decay_t<Types>>...>;
105
107template <typename T, typename... Types>
109 std::is_convertible<std::decay_t<T>, std::decay_t<Types>>...>;
118template <typename T, typename S>
121
123template <typename T, typename S>
134template <typename T, typename S>
138
141template <typename T, typename S>
145
148template <typename T, typename... Types>
152
155template <typename T, typename... Types>
159
162template <typename T, typename... Types>
165
168template <typename T, typename... Types>
171
173template <typename T, typename S>
177
179template <typename T, typename S>
183
186template <typename T, typename... Types>
190
193template <typename T, typename... Types>
197
200template <typename T, typename... Types>
203
206template <typename T, typename... Types>
217template <typename T, typename S>
228template <typename T, typename S>
232
235template <typename T, typename S>
239
242template <typename T, typename... Types>
243using require_all_st_constructible = require_all_t<std::is_constructible<
245
248template <typename T, typename... Types>
249using require_any_st_constructible = require_any_t<std::is_constructible<
251
254template <typename T, typename... Types>
256 = require_all_not_t<std::is_constructible<
258
261template <typename T, typename... Types>
263 = require_any_not_t<std::is_constructible<
265
267template <typename T, typename S>
271
273template <typename T, typename S>
277
280template <typename T, typename... Types>
281using require_all_vt_constructible = require_all_t<std::is_constructible<
283
286template <typename T, typename... Types>
287using require_any_vt_constructible = require_any_t<std::is_constructible<
289
292template <typename T, typename... Types>
294 = require_all_not_t<std::is_constructible<
296
299template <typename T, typename... Types>
301 = require_any_not_t<std::is_constructible<
311template <typename T>
313
315template <typename T>
318
320template <typename... Types>
323
325template <typename... Types>
328
330template <typename... Types>
333
336template <typename... Types>
346template <typename... Types>
349
352template <typename... Types>
354 std::is_arithmetic<value_type_t<std::decay_t<Types>>>...>;
355
357template <typename T>
360
362template <typename T>
365
367template <typename... Types>
370
372template <typename... Types>
375
377template <typename... Types>
379 std::is_arithmetic<scalar_type_t<std::decay_t<Types>>>...>;
388template <typename T>
399template <typename T>
408template <typename T>
411
413template <typename T>
416
418template <typename T>
421
423template <typename... Types>
425 std::is_integral<scalar_type_t<std::decay_t<Types>>>...>;
428} // namespace stan
429#endif
require_all_t< std::is_arithmetic< std::decay_t< Types > >... > require_all_arithmetic_t
Require all of the types satisfy std::is_arithmetic.
require_t< std::is_arithmetic< std::decay_t< T > > > require_arithmetic_t
Require type satisfies std::is_arithmetic.
require_all_t< std::is_arithmetic< scalar_type_t< std::decay_t< Types > > >... > require_all_st_arithmetic
Require all of the scalar types satisfy std::is_arithmetic.
require_any_t< std::is_arithmetic< scalar_type_t< std::decay_t< Types > > >... > require_any_st_arithmetic
Require any of the scalar types satisfy std::is_arithmetic.
require_not_t< std::is_arithmetic< std::decay_t< T > > > require_not_arithmetic_t
Require type does not satisfy std::is_arithmetic.
require_not_t< std::is_arithmetic< scalar_type_t< std::decay_t< T > > > > require_not_st_arithmetic
Require scalar type does not satisfy std::is_arithmetic.
require_any_not_t< std::is_arithmetic< scalar_type_t< std::decay_t< Types > > >... > require_any_not_st_arithmetic
Any of the scalar types do not satisfy std::is_arithmetic.
require_any_t< std::is_arithmetic< std::decay_t< Types > >... > require_any_arithmetic_t
Require any of the types satisfy std::is_arithmetic.
require_any_not_t< std::is_arithmetic< value_type_t< std::decay_t< Types > > >... > require_any_not_vt_arithmetic
Require at least one of the value types do not satisfy std::is_arithmetic.
require_t< std::is_arithmetic< scalar_type_t< std::decay_t< T > > > > require_st_arithmetic
Require scalar type satisfies std::is_arithmetic.
require_all_not_t< std::is_arithmetic< std::decay_t< Types > >... > require_all_not_arithmetic_t
Require none of the types satisfy std::is_arithmetic.
require_all_t< std::is_arithmetic< value_type_t< std::decay_t< Types > > >... > require_all_vt_arithmetic
Require all of the value types satisfy std::is_arithmetic.
require_any_not_t< std::is_arithmetic< std::decay_t< Types > >... > require_any_not_arithmetic_t
Require at least one of the types do not satisfy std::is_arithmetic.
require_all_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_all_st_assignable
All scalar types of T and all of the Types satisfy std::is_assignable.
require_t< std::is_assignable< std::decay_t< T >, std::decay_t< S > > > require_assignable_t
Require types T and S satisfies std::is_assignable.
require_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< S > > > > require_vt_assignable
Value types of T and S satisfies std::is_assignable.
require_all_not_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_all_not_st_assignable
None of the scalar types of Types and T satisfy std::is_assignable.
require_any_not_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_any_not_st_assignable
Any of the scalar types Types and T do not satisfy std::is_assignable.
require_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_st_assignable
Require that value types of T and S satisfies std::is_assignable.
require_any_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_any_st_assignable
Any of the scalar types of Types and T satisfy std::is_assignable.
require_all_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_all_vt_assignable
Value types of T and all of the Types satisfy std::is_assignable.
require_not_t< std::is_assignable< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_not_st_assignable
Require scalar types of T and S does not satisfy std::is_assignable.
require_not_t< std::is_assignable< std::decay_t< T >, std::decay_t< S > > > require_not_assignable_t
Require types T and S does not satisfy std::is_assignable.
require_all_not_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_all_not_vt_assignable
None of the value types of Types and T satisfy std::is_assignable.
require_any_not_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_any_not_vt_assignable
Any of the value types Types and T do not satisfy std::is_assignable.
require_any_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_any_vt_assignable
Any of the value types of Types and T satisfy std::is_assignable.
require_not_t< std::is_assignable< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< S > > > > require_not_vt_assignable
Value types of T and S does not satisfy std::is_assignable.
require_all_not_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_all_not_st_constructible
None of the scalar types of Types and T satisfy std::is_constructible.
require_any_not_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_any_not_vt_constructible
Any of the value types Types and T do not satisfy std::is_constructible.
require_not_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_not_st_constructible
Require scalar types of T and S does not satisfy std::is_constructible.
require_all_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_all_vt_constructible
Value types of T and all of the Types satisfy std::is_constructible.
require_any_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_any_vt_constructible
Any of the value types of Types and T satisfy std::is_constructible.
require_all_not_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_all_not_vt_constructible
None of the value types of Types and T satisfy std::is_constructible.
require_not_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< S > > > > require_not_vt_constructible
Value types of T and S does not satisfy std::is_constructible.
require_all_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_all_st_constructible
All scalar types of T and all of the Types satisfy std::is_constructible.
require_t< std::is_constructible< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< S > > > > require_vt_constructible
Value types of T and S satisfies std::is_constructible.
require_t< std::is_constructible< std::decay_t< T >, std::decay_t< S > > > require_constructible_t
Require types T and S satisfies std::is_constructible.
require_any_not_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_any_not_st_constructible
Any of the scalar types Types and T do not satisfy std::is_constructible.
require_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_st_constructible
Require that value types of T and S satisfies std::is_constructible.
require_any_t< std::is_constructible< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_any_st_constructible
Any of the scalar types of Types and T satisfy std::is_constructible.
require_not_t< std::is_convertible< std::decay_t< T >, std::decay_t< S > > > require_not_convertible_t
Require types T and S does not satisfy std::is_convertible.
require_t< std::is_convertible< std::decay_t< T >, std::decay_t< S > > > require_convertible_t
Require types T and S satisfies std::is_convertible.
require_any_not_t< std::is_convertible< std::decay_t< T >, std::decay_t< Types > >... > require_any_not_convertible_t
Any one of the Types and T do not satisfy.
require_all_t< std::is_convertible< std::decay_t< T >, std::decay_t< Types > >... > require_all_convertible_t
Require T and all of the Types satisfy std::is_convertible.
require_t< std::is_floating_point< std::decay_t< T > > > require_floating_point_t
Require type satisfies std::is_floating_point.
require_all_not_t< std::is_integral< scalar_type_t< std::decay_t< Types > > >... > require_all_not_st_integral
Require none of the scalar types satisfy std::is_integral.
require_t< std::is_integral< std::decay_t< T > > > require_integral_t
Require type satisfies std::is_integral.
require_t< std::is_integral< value_type_t< std::decay_t< T > > > > require_vt_integral
Require value type satisfies std::is_integral.
require_not_t< std::is_integral< scalar_type_t< std::decay_t< T > > > > require_not_st_integral
Require scalar type does not satisfy std::is_integral.
require_t< std::is_integral< scalar_type_t< std::decay_t< T > > > > require_st_integral
Require scalar type satisfies std::is_integral.
require_all_t< std::is_same< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_all_st_same
All scalar types of T and all of the Types satisfy std::is_same.
require_t< std::is_same< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_st_same
Require that value types of T and S satisfies std::is_same.
require_not_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_not_same_t
Require types T and S does not satisfy std::is_same.
require_all_t< std::is_same< std::decay_t< T >, std::decay_t< Types > >... > require_all_same_t
Require T and all of the Types satisfy std::is_same.
require_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_same_t
Require types T and S satisfies std::is_same.
require_not_t< std::is_same< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< S > > > > require_not_st_same
Require scalar types of T and S does not satisfy std::is_same.
require_all_not_t< std::is_same< std::decay_t< T >, std::decay_t< Types > >... > require_all_not_same_t
Require none of the Types and T satisfy std::is_same.
require_any_not_t< std::is_same< std::decay_t< T >, std::decay_t< Types > >... > require_any_not_same_t
Any one of the Types and T do not satisfy std::is_same.
require_any_t< std::is_same< std::decay_t< T >, std::decay_t< Types > >... > require_any_same_t
Require any of the Types and T satisfy std::is_same.
require_any_not_t< std::is_same< scalar_type_t< std::decay_t< T > >, scalar_type_t< std::decay_t< Types > > >... > require_any_not_st_same
Any of the scalar types Types and T do not satisfy std::is_same.
require_t< std::is_same< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< S > > > > require_vt_same
Value types of T and S satisfies std::is_same.
require_all_t< std::is_same< value_type_t< std::decay_t< T > >, value_type_t< std::decay_t< Types > > >... > require_all_vt_same
Value types of T and all of the Types satisfy std::is_same.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
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.
typename scalar_type< T >::type scalar_type_t
std::enable_if_t<!math::conjunction< Checks... >::value > require_any_not_t
If any condition is 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 ...