cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
rcp.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_COMPLEX_FUNCTIONS_RCP_H
4#define pRC_CORE_COMPLEX_FUNCTIONS_RCP_H
5
8
9namespace pRC
10{
11 template<IsComplex T>
12 static inline constexpr auto rcp(T const &b)
13 {
14 auto const denominator = rcp(norm<2, 1>(b));
15 auto const real = b.real() * denominator;
16 auto const imag = -b.imag() * denominator;
17
18 return Complex(real, imag);
19 }
20}
21#endif // pRC_CORE_COMPLEX_FUNCTIONS_RCP_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr auto rcp(T const &b)
Definition rcp.hpp:12
Complex(T const &) -> Complex< T >
static constexpr decltype(auto) real(X &&a)
Definition real.hpp:12
static constexpr decltype(auto) imag(X &&a)
Definition imag.hpp:12
static constexpr auto norm(T const &a)
Definition norm.hpp:12