cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
reference.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_TENSOR_VIEWS_REFERENCE_H
4#define pRC_TENSOR_TRAIN_TENSOR_VIEWS_REFERENCE_H
5
7
9{
10 template<class T, class N, class Ranks>
11 class Reference;
12
13 template<class T, class N, class Ranks>
15
16 template<class T, class N, class Ranks>
17 class Reference : public Assignable<T, N, Ranks, Reference<T, N, Ranks>>
18 {
19 private:
21
22 public:
24 : mA(a)
25 {
26 }
27
28 using Base::operator=;
29
30 template<Index C>
31 constexpr decltype(auto) core()
32 {
33 return mA.template core<C>();
34 }
35
36 template<Index C>
37 constexpr decltype(auto) core() const
38 {
39 return asConst(mA).template core<C>();
40 }
41
42 private:
44 };
45}
46#endif // pRC_TENSOR_TRAIN_TENSOR_VIEWS_REFERENCE_H
Definition assignable.hpp:13
Definition reference.hpp:18
Reference(Tensor< T, N, Ranks > &a)
Definition reference.hpp:23
constexpr decltype(auto) core()
Definition reference.hpp:31
constexpr decltype(auto) core() const
Definition reference.hpp:37
Definition declarations.hpp:16
Definition declarations.hpp:19
Reference(Tensor< T, N, Ranks > &) -> Reference< T, N, Ranks >
static constexpr AddConst< X > & asConst(X &a)
Definition basics.hpp:71