cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
value.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_VALUE_H
4#define pRC_CORE_VALUE_VALUE_H
5
6#include <prc/config.hpp>
8
9namespace pRC
10{
11 template<Size Width = DEFAULT_FLOAT>
12 class Float;
13
14 template<Bool S = true, Size Width = sizeof(int) * 8>
15 class Integer;
16
17 template<Size W = sizeof(int) * 8>
19
20 template<Size W = sizeof(int) * 8>
22
23 template<class T>
24 concept IsFloat = !IsReference<T> && requires {
25 {
26 []<Size W>(Float<W> const &&)
27 {
28 }(std::declval<T>())
29 };
30 };
31
32 template<class T>
33 concept IsInteger = !IsReference<T> && requires {
34 {
35 []<Bool S, Size W>(Integer<S, W> const &&)
36 {
37 }(std::declval<T>())
38 };
39 };
40
41 template<class T>
43 IsInteger<T> && requires { requires(T::Signed == true); };
44
45 template<class T>
47 IsInteger<T> && requires { requires(T::Signed == false); };
48
49 template<class T>
51
52 template<class T>
53 struct ValueType
54 {
55 using Type = Undefined;
56 };
57
58 template<IsValue T>
59 struct ValueType<T>
60 {
62 };
63
64 template<class T>
65 requires requires { typename T::Type; }
70
71 template<class T>
72 using Value = typename ValueType<T>::Type;
73}
74#endif // pRC_CORE_VALUE_VALUE_H
Definition value.hpp:12
Definition value.hpp:15
Definition value.hpp:24
Definition value.hpp:33
Definition concepts.hpp:19
Definition value.hpp:42
Definition value.hpp:46
Definition value.hpp:50
TN::Subscripts S
Definition externs_nonTT.hpp:9
Definition cholesky.hpp:10
Float(Float< 16 >::Fundamental const) -> Float< 16 >
std::size_t Size
Definition basics.hpp:31
std::remove_const_t< T > RemoveConst
Definition basics.hpp:44
typename ValueType< T >::Type Value
Definition value.hpp:72
Integer(Integer< true, 8 >::Fundamental const) -> Integer< true, 8 >
Definition gtest_pred_impl_unittest.cc:54
RemoveConst< T > Type
Definition value.hpp:61
Definition value.hpp:54
Undefined Type
Definition value.hpp:55