pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_COMMON_H
4#define pRC_CORE_VALUE_COMMON_H
5
8
9namespace pRC
10{
11 template<class TA, class TB>
13 {
14 using Type =
15 Conditional<IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB>;
16 };
17
18 template<class TA, class TB>
19 struct CommonType<TA, TB,
21 {
22 using Type =
23 Conditional<IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB>;
24 };
25
26 template<class TA, class TB>
27 struct CommonType<TA, TB,
29 {
30 using Type =
31 Conditional<IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB>;
32 };
33
34 template<class TA, class TB>
35 struct CommonType<TA, TB,
37 {
38 using Type =
39 Conditional<IsSatisfied<(sizeof(TA) >= sizeof(TB))>, TA, TB>;
40 };
41
42 template<class TA, class TB>
44 {
45 using Type =
46 Conditional<IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB>;
47 };
48
49 template<class TA, class TB>
51 : CommonType<TA, Float<>>
52 {
53 };
54
55 template<class TA, class TB>
57 : CommonType<Float<>, TB>
58 {
59 };
60}
61#endif // pRC_CORE_VALUE_COMMON_H
Definition cholesky.hpp:18
std::conjunction< Bs... > All
Definition type_traits.hpp:77
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
Any< IsSignedInteger< T >, IsUnsignedInteger< T > > IsInteger
Definition type_traits.hpp:69
Constant< Bool, B > IsSatisfied
Definition type_traits.hpp:71
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
std::conditional_t< B{}, T, F > Conditional
Definition type_traits.hpp:131
Conditional< IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB > Type
Definition common.hpp:46
Conditional< IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB > Type
Definition common.hpp:15
Conditional< IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB > Type
Definition common.hpp:31
Conditional< IsSatisfied<(sizeof(TA) >=sizeof(TB))>, TA, TB > Type
Definition common.hpp:39
Conditional< IsSatisfied<(sizeof(TA) > sizeof(TB))>, TA, TB > Type
Definition common.hpp:23
Definition common.hpp:36
Definition type_traits.hpp:16
Definition type_traits.hpp:37
Definition type_traits.hpp:55