pRC
multi-purpose Tensor Train library for C++
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_OPERATOR_VIEWS_REFERENCE_H
4#define pRC_TENSOR_TRAIN_OPERATOR_VIEWS_REFERENCE_H
5
7
9{
10 template<class T, class M, class N, class Ranks>
11 class Reference;
12
13 template<class T, class M, class N, class Ranks>
15
16 template<class T, class M, class N, class Ranks>
18 : public Assignable<T, M, N, Ranks, Reference<T, M, N, Ranks>>
19 {
20 private:
22
23 public:
25 : mA(a)
26 {
27 }
28
29 using Base::operator=;
30
31 template<Index C>
32 constexpr decltype(auto) core()
33 {
34 return mA.template core<C>();
35 }
36
37 template<Index C>
38 constexpr decltype(auto) core() const
39 {
40 return asConst(mA).template core<C>();
41 }
42
43 private:
45 };
46}
47#endif // pRC_TENSOR_TRAIN_OPERATOR_VIEWS_REFERENCE_H
Definition type_traits.hpp:40
constexpr decltype(auto) core()
Definition reference.hpp:32
Reference(Operator< T, M, N, Ranks > &a)
Definition reference.hpp:24
constexpr decltype(auto) core() const
Definition reference.hpp:38
Definition type_traits.hpp:17
Definition type_traits.hpp:35
Reference(Tensor< T, Ns... > &) -> Reference< T, Sizes< Ns... > >
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
AddConst< T > & asConst(T &a)
Definition type_traits.hpp:208