cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
inflate.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_INFLATE_H
4#define pRC_CORE_TENSOR_FUNCTIONS_INFLATE_H
5
8
9namespace pRC
10{
11 template<Size... Is>
12 struct Inflate;
13
14 template<Size... Is, class X, class R = RemoveReference<X>,
16 If<IsSatisfied<(sizeof...(Is) == typename R::Dimension())>> = 0>
17 static inline constexpr auto inflate(X &&a)
18 {
20 return TensorViews::Inflate<typename R::Type,
21 decltype(typename R::Sizes() * Sizes<Is...>()), Sizes<Is...>, V>(
22 view(forward<X>(a)));
23 }
24
25 template<Size... Is, class X, class R = RemoveReference<X>,
27 If<IsInvocable<Inflate<Is...>, X &>> = 0>
28 static inline constexpr auto inflate(X &&a)
29 {
30 return eval(inflate<Is...>(a));
31 }
32}
33#endif // pRC_CORE_TENSOR_FUNCTIONS_INFLATE_H
Definition sequence.hpp:56
Definition inflate.hpp:11
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto inflate(X &&a)
Definition inflate.hpp:17
std::size_t Size
Definition type_traits.hpp:20
static constexpr X view(X &&a)
Definition view.hpp:12
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
Constant< Bool, B > IsSatisfied
Definition type_traits.hpp:71
std::is_invocable< F, Args... > IsInvocable
Definition type_traits.hpp:134