pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
prc
tensor_train
operator
functions
apply.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
4
#define pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
5
6
#include <
prc/core/functors/apply.hpp
>
7
#include <
prc/core/functors/mul.hpp
>
8
#include <
prc/core/functors/restrict.hpp
>
9
#include <
prc/core/functors/transform.hpp
>
10
#include <
prc/core/tensor/operator/hint.hpp
>
11
#include <
prc/tensor_train/operator/functions/mul.hpp
>
12
#include <
prc/tensor_train/operator/functions/restrict.hpp
>
13
#include <
prc/tensor_train/operator/functions/transform.hpp
>
14
15
namespace
pRC
16
{
17
template
<
Operator::Transform
OT
=
Operator::Transform::None
,
18
Operator::Restrict
OR
=
Operator::Restrict::None
,
19
Operator::Hint
OH
=
Operator::Hint::None
,
class
XA
,
class
XB
,
20
class
RA
=
RemoveReference<XA>
,
class
RB
=
RemoveReference<XB>
,
21
If<TensorTrain::IsOperatorish<RA>
> = 0,
If<IsInvocable<View, XA>
> = 0,
22
If<Any<TensorTrain::IsOperatorish<RB>
, TensorTrain::IsTensorish<RB>>> =
23
0,
24
If<IsInvocable<View, XB>
> = 0,
If<IsInvocable<Transform<OT>
,
XA
>> = 0,
25
If<IsInvocable<Mul, ResultOf<Restrict<OR>
,
ResultOf<Transform<OT>
,
XA
>>,
26
XB
>> = 0>
27
static
inline
constexpr
auto
apply
(
XA
&&a,
XB
&&b)
28
{
29
return
restrict<OR>
(
transform<OT>
(
forward<XA>
(a))) *
forward<XB>
(b);
30
}
31
32
template
<
Operator::Transform
OT
=
Operator::Transform::None
,
33
Operator::Restrict
OR
=
Operator::Restrict::None
,
34
Operator::Hint
OH
=
Operator::Hint::None
,
class
XA
,
class
XB
,
35
class
RA
=
RemoveReference<XA>
,
class
RB
=
RemoveReference<XB>
,
36
If<TensorTrain::IsOperatorish<RA>
> = 0,
37
If<Any<TensorTrain::IsOperatorish<RB>
, TensorTrain::IsTensorish<RB>>> =
38
0,
39
If<Not<All<IsInvocable<View, XA>
,
IsInvocable<View, XB>
>>> = 0,
40
If<IsInvocable<Apply<OT, OR, OH>
,
XA
&,
XB
&>> = 0>
41
static
inline
constexpr
auto
apply
(
XA
&&a,
XB
&&b)
42
{
43
return
eval
(
apply<OT, OR, OH>
(a, b));
44
}
45
}
46
#endif
// pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
apply.hpp
mul.hpp
restrict.hpp
transform.hpp
hint.hpp
pRC::Operator::Restrict
Restrict
This enum's elements denote a restriction of an operator.
Definition
restrict.hpp:27
pRC::Operator::Restrict::None
@ None
pRC::Operator::Hint
Hint
This enum's elements denote a hint regarding an operator.
Definition
hint.hpp:30
pRC::Operator::Hint::None
@ None
pRC::Operator::Transform
Transform
This enum's elements denote a transformation done to an operator.
Definition
transform.hpp:23
pRC::Operator::Transform::None
@ None
pRC
Definition
cholesky.hpp:18
pRC::eval
static constexpr X eval(X &&a)
Definition
eval.hpp:11
pRC::apply
static constexpr decltype(auto) apply(JacobiRotation< T > const &r, X &&m, Index const p, Index const q)
Definition
jacobi_rotation.hpp:334
pRC::copy
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition
copy.hpp:13
mul.hpp
restrict.hpp
transform.hpp
Generated by
1.9.8