pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
add.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_ADD_H
4#define pRC_CORE_VALUE_FUNCTIONS_ADD_H
5
10
11namespace pRC
12{
22 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsFloat<TB>> = 0>
23 static inline constexpr auto operator+(TA const &a, TB const &b)
24 {
25 return Float(a() + b());
26 }
27
37 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsFloat<TB>> = 0>
38 static inline constexpr auto operator+(TA const &a, TB const &b)
39 {
40 return cast<Float<>>(a) + b;
41 }
42
52 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsInteger<TB>> = 0>
53 static inline constexpr auto operator+(TA const &a, TB const &b)
54 {
55 return a + cast<Float<>>(b);
56 }
57
67 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsInteger<TB>> = 0>
68 static inline constexpr auto operator+(TA const &a, TB const &b)
69 {
70 return Integer(a() + b());
71 }
72}
73#endif // pRC_CORE_VALUE_FUNCTIONS_ADD_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto operator+(Sequence< T, As... > const, Sequence< T, Bs... > const)
Definition sequence.hpp:110
Integer(Integer< true, 8 >::Fundamental const) -> Integer< true, 8 >