cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
zero.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_ZERO_H
4#define pRC_CORE_VALUE_ZERO_H
5
8
9namespace pRC
10{
11 template<class T>
12 struct Zero<T, If<IsValue<T>>>
13 {
14 constexpr T operator()()
15 {
16 return 0;
17 }
18 };
19
20 template<>
21 struct Zero<Float<16>>
22 {
24 {
25 return BFloat16::FromRepresentation(0x0000);
26 }
27 };
28}
29#endif // pRC_CORE_VALUE_ZERO_H
static constexpr auto FromRepresentation(Representation const rep)
Definition bfloat16.hpp:26
Definition cholesky.hpp:18
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
Any< IsFloat< T >, IsInteger< T > > IsValue
Definition type_traits.hpp:72
constexpr Float< 16 > operator()()
Definition zero.hpp:23
constexpr T operator()()
Definition zero.hpp:14
Definition type_traits.hpp:268