cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
linearize.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_LINEARIZE_H
4#define pRC_CORE_TENSOR_FUNCTIONS_LINEARIZE_H
5
8
9namespace pRC
10{
11 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
12 If<IsSatisfied<(typename R::Dimension{} > 0)>> = 0,
13 If<IsInvocable<Reshape<R::Sizes::size()>, X>> = 0>
14 static inline constexpr auto linearize(X &&a)
15 {
16 return reshape<R::Sizes::size()>(forward<X>(a));
17 }
18}
19#endif // pRC_CORE_TENSOR_FUNCTIONS_LINEARIZE_H
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
static constexpr auto linearize(X &&a)
Definition linearize.hpp:14
std::is_invocable< F, Args... > IsInvocable
Definition type_traits.hpp:134