cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
print.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_PRINT_H
4#define pRC_CORE_TENSOR_FUNCTIONS_PRINT_H
5
10
11namespace pRC
12{
13 template<class X, class S, class R = RemoveReference<X>,
14 If<IsTensorish<R>> = 0>
15 static inline void print(X &&arg, S &&stream)
16 {
17 if constexpr(typename R::Dimension() == 0)
18 {
19 return print(arg(), stream);
20 }
21 else
22 {
24 print(":\n", stream);
26 [&arg, &stream](auto const... indices)
27 {
28 print(typename R::Subscripts(indices...), stream);
29
30 print(": ", stream);
31 print(arg(indices...), stream);
32 print('\n', stream);
33 });
34 }
35 }
36}
37#endif // pRC_CORE_TENSOR_FUNCTIONS_PRINT_H
TN::Subscripts S
Definition externs_nonTT.hpp:9
Definition cholesky.hpp:18
static constexpr auto arg(Complex< T > const &a)
Definition arg.hpp:12
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::invoke_result_t< F, Args... > ResultOf
Definition type_traits.hpp:140
static auto print(String< N > const &string, std::FILE *stream)
Definition print.hpp:18
static constexpr auto name()
Definition type_name.hpp:11