cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
sub.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_SUB_H
4#define pRC_CORE_VALUE_FUNCTIONS_SUB_H
5
10
11namespace pRC
12{
13 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsFloat<TB>> = 0>
14 static inline constexpr auto operator-(TA const &a, TB const &b)
15 {
16 return Float(a() - b());
17 }
18
19 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsFloat<TB>> = 0>
20 static inline constexpr auto operator-(TA const &a, TB const &b)
21 {
22 return cast<Float<>>(a) - b;
23 }
24
25 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsInteger<TB>> = 0>
26 static inline constexpr auto operator-(TA const &a, TB const &b)
27 {
28 return a - cast<Float<>>(b);
29 }
30
31 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsInteger<TB>> = 0>
32 static inline constexpr auto operator-(TA const &a, TB const &b)
33 {
34 return Integer(a() - b());
35 }
36}
37#endif // pRC_CORE_VALUE_FUNCTIONS_SUB_H
Definition cholesky.hpp:18
Float(Float< 16 >::Fundamental const) -> Float< 16 >
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto operator-(Sequence< T, As... > const, Sequence< T, Bs... > const)
Definition sequence.hpp:132
Integer(Integer< true, 8 >::Fundamental const) -> Integer< true, 8 >