cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
tensor_train
common
functions
minus.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_MINUS_H
4
#define pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_MINUS_H
5
6
#include <
prc/tensor_train/operator/declarations.hpp
>
7
#include <
prc/tensor_train/tensor/declarations.hpp
>
8
9
namespace
pRC
10
{
11
template
<
class
X,
class
R = RemoveReference<X>>
12
requires
(TensorTrain::IsTensorish<R> || TensorTrain::IsOperatorish<R>)
13
static
inline
constexpr
auto
operator
-(X &&a)
14
{
15
return
enumerate
(
16
[]<
Index
C>(
auto
&&a)
17
{
18
if
constexpr
(C == 0)
19
{
20
return
-forward<decltype(a)>(a);
21
}
22
else
23
{
24
return
forward<decltype(a)>(a);
25
}
26
},
27
forward<X>(a));
28
}
29
}
30
#endif
// pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_MINUS_H
pRC
Definition
cholesky.hpp:10
pRC::Index
Size Index
Definition
basics.hpp:32
pRC::enumerate
static constexpr auto enumerate(F &&f, Xs &&...args)
Definition
enumerate.hpp:21
declarations.hpp
declarations.hpp
Generated by
1.11.0