cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
unit.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_UNIT_H
4#define pRC_CORE_TENSOR_UNIT_H
5
10
11namespace pRC
12{
13 template<IsTensor T>
14 struct Unit<T>
15 {
16 constexpr auto operator()() const
17 {
18 auto const f = []()
19 {
21 };
22 using F = RemoveConstReference<decltype(f)>;
23 using Sizes = typename T::Sizes;
25 }
26
27 template<class X>
29 constexpr auto operator()(X &&value) const
30 {
31 auto const f = [value = typename T::Type(forward<X>(value))]()
32 {
33 return value;
34 };
35 using F = RemoveConstReference<decltype(f)>;
36 using Sizes = typename T::Sizes;
38 }
39 };
40
41 template<IsTensorView T>
42 struct Unit<T> : Unit<ResultOf<Eval, T>>
43 {
44 };
45}
46#endif // pRC_CORE_TENSOR_UNIT_H
Definition value.hpp:12
Definition sequence.hpp:29
Definition loop.hpp:19
Definition concepts.hpp:37
int value
Definition gmock-actions_test.cc:1714
Definition cholesky.hpp:10
static constexpr auto unit()
Definition unit.hpp:13
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition basics.hpp:47
constexpr auto operator()() const
Definition unit.hpp:16
constexpr auto operator()(X &&value) const
Definition unit.hpp:29