cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
identity.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_COMPLEX_IDENTITY_H
4#define pRC_CORE_COMPLEX_IDENTITY_H
5
8
9namespace pRC
10{
11 template<class T>
12 struct Identity<T, If<IsComplex<T>>>
13 {
14 constexpr auto operator()()
15 {
16 using U = typename T::Type;
17 return Complex<U>(identity<U>(), zero<U>());
18 }
19
20 template<class X, If<IsConstructible<T, X>> = 0>
21 constexpr auto operator()(X &&value)
22 {
23 using U = typename T::Type;
24 return Complex<U>(forward<X>(value), zero<U>());
25 }
26 };
27}
28#endif // pRC_CORE_COMPLEX_IDENTITY_H
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
constexpr auto operator()(X &&value)
Definition identity.hpp:21
constexpr auto operator()()
Definition identity.hpp:14
Definition type_traits.hpp:262
Definition type_traits.hpp:15