pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
delta.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_COMPLEX_FUNCTIONS_DELTA_H
4#define pRC_CORE_COMPLEX_FUNCTIONS_DELTA_H
5
8
9namespace pRC
10{
11 template<class TA, class TB, If<IsInvocable<Sub, TA, TB>> = 0>
12 static inline constexpr auto delta(Complex<TA> const &a,
13 Complex<TB> const &b)
14 {
15 auto const real = delta(a.real(), b.real());
16 auto const imag = delta(a.imag(), b.imag());
17
18 return abs(Complex(real, imag));
19 }
20
21 template<class TA, class TB, If<IsValue<TB>> = 0,
22 If<IsInvocable<Sub, TA, TB>> = 0>
23 static inline constexpr auto delta(Complex<TA> const &a, TB const &b)
24 {
25 auto const real = delta(a.real(), b.real());
26 auto const imag = a.imag();
27
28 return abs(Complex(real, imag));
29 }
30
31 template<class TA, class TB, If<IsValue<TA>> = 0,
32 If<IsInvocable<Sub, TA, TB>> = 0>
33 static inline constexpr auto delta(TA const &a, Complex<TB> const &b)
34 {
35 auto const real = delta(a.real(), b.real());
36 auto const imag = b.imag();
37
38 return abs(Complex(real, imag));
39 }
40}
41#endif // pRC_CORE_COMPLEX_FUNCTIONS_DELTA_H
Definition complex.hpp:26
constexpr decltype(auto) real() &&
Definition complex.hpp:125
constexpr decltype(auto) imag() &&
Definition complex.hpp:145
Definition cholesky.hpp:18
static constexpr decltype(auto) imag(X &&a)
Definition imag.hpp:11
static constexpr decltype(auto) real(X &&a)
Definition real.hpp:11
static constexpr auto delta(Complex< TA > const &a, Complex< TB > const &b)
Definition delta.hpp:12
static constexpr auto abs(Complex< T > const &a)
Definition abs.hpp:12
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13