pRC
multi-purpose Tensor Train library for C++
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{
16 template<class T>
17 struct Zero<T, If<IsValue<T>>>
18 {
22 constexpr T operator()()
23 {
24 return 0;
25 }
26 };
27
34 template<>
35 struct Zero<Float<16>>
36 {
41 {
42 return BFloat16::FromRepresentation(0x0000);
43 }
44 };
45}
46#endif // pRC_CORE_VALUE_ZERO_H
static constexpr auto FromRepresentation(Representation const rep)
Definition bfloat16.hpp:34
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
Any< IsFloat< T >, IsInteger< T > > IsValue
Definition type_traits.hpp:72
constexpr Float< 16 > operator()()
Returns the zero, i.e. 0.
Definition zero.hpp:40
constexpr T operator()()
Returns the zero, i.e. 0.
Definition zero.hpp:22
Definition type_traits.hpp:268