pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
div.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_DIV_H
4#define pRC_CORE_VALUE_FUNCTIONS_DIV_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
70 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsInteger<TB>> = 0>
71 static inline constexpr auto operator/(TA const &a, TB const &b)
72 {
73 return Integer(a() / b());
74 }
75}
76#endif // pRC_CORE_VALUE_FUNCTIONS_DIV_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
static constexpr auto operator/(Sequence< T, As... > const, Sequence< T, Bs... > const)
Definition sequence.hpp:169
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
Integer(Integer< true, 8 >::Fundamental const) -> Integer< true, 8 >