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_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 type_traits.hpp:40
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 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