cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
view.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_VIEW_H
4#define pRC_CORE_TENSOR_FUNCTIONS_VIEW_H
5
8
9namespace pRC
10{
11 template<class X, If<IsTensorView<RemoveReference<X>>> = 0>
12 static inline constexpr X view(X &&a)
13 {
14 return forward<X>(a);
15 }
16
17 template<class T, Size... Ns>
18 static inline constexpr auto view(Tensor<T, Ns...> const &a)
19 {
21 }
22
23 template<class T, Size... Ns>
24 static inline constexpr auto view(Tensor<T, Ns...> &a)
25 {
26 return TensorViews::Reference(a);
27 }
28
29 template<class T, Size... Ns>
30 static inline constexpr auto view(Tensor<T, Ns...> const &&) = delete;
31}
32#endif // pRC_CORE_TENSOR_FUNCTIONS_VIEW_H
Definition tensor.hpp:28
pRC::Float<> T
Definition externs_nonTT.hpp:1
ReferenceToConst(Tensor< T, Ns... > const &) -> ReferenceToConst< T, Sizes< Ns... > >
Reference(Tensor< T, Ns... > &) -> Reference< T, Sizes< Ns... > >
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::size_t Size
Definition type_traits.hpp:20
static constexpr X view(X &&a)
Definition view.hpp:12