cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
transform.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_TRANSFORM_H
4#define pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_TRANSFORM_H
5
9
10namespace pRC
11{
12 template<Operator::Transform OT = Operator::Transform::None, class X>
13 requires TensorTrain::IsOperatorish<RemoveReference<X>> &&
15 static inline constexpr auto transform(X &&a)
16 {
17 return transpose(forward<X>(a));
18 }
19
20 template<Operator::Transform OT = Operator::Transform::None, class X>
21 requires TensorTrain::IsOperatorish<RemoveReference<X>> &&
23 static inline constexpr auto transform(X &&a)
24 {
25 return adjoint(forward<X>(a));
26 }
27
28 template<Operator::Transform OT = Operator::Transform::None, class X>
29 requires TensorTrain::IsOperatorish<RemoveReference<X>> &&
31 static inline constexpr auto transform(X &&a)
32 {
33 if constexpr(!IsInvocable<View, X>)
34 {
35 return eval(forward<X>(a));
36 }
37 else
38 {
39 return view(forward<X>(a));
40 }
41 }
42}
43#endif // pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_TRANSFORM_H
Definition concepts.hpp:31
Definition cholesky.hpp:10
static constexpr auto transform(X &&a)
Definition transform.hpp:15
static constexpr decltype(auto) view(X &&a)
Definition view.hpp:13
static constexpr auto transpose(JacobiRotation< T > const &a)
Definition jacobi_rotation.hpp:306
static constexpr auto adjoint(JacobiRotation< T > const &a)
Definition jacobi_rotation.hpp:312
static constexpr decltype(auto) eval(X &&a)
Definition eval.hpp:12