cMHN 1.2
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>
12 requires IsTensorView<RemoveReference<X>>
13 static inline constexpr decltype(auto) view(X &&a)
14 {
15 return as(forward<X>(a));
16 }
17
18 template<class T, Size... Ns>
19 static inline constexpr auto view(Tensor<T, Ns...> const &a)
20 {
22 }
23
24 template<class T, Size... Ns>
25 static inline constexpr auto view(Tensor<T, Ns...> &a)
26 {
27 return TensorViews::Reference(a);
28 }
29
30 template<class T, Size... Ns>
31 static inline constexpr auto view(Tensor<T, Ns...> const &&) = delete;
32}
33#endif // pRC_CORE_TENSOR_FUNCTIONS_VIEW_H
Definition tensor.hpp:25
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:10
std::size_t Size
Definition basics.hpp:31
static constexpr decltype(auto) view(X &&a)
Definition view.hpp:13
static constexpr RemoveConst< X > as(X &&a)
Definition basics.hpp:83