cMHN 1.2
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
9
10namespace pRC
11{
12 template<class X, class S, IsTensorish R = RemoveReference<X>>
13 requires(R::Dimension == 0)
14 static inline void print(X &&arg, S &&stream)
15 {
16 return print(arg(), stream);
17 }
18
19 template<class X, class S, IsTensorish R = RemoveReference<X>>
20 static inline void print(X &&arg, S &&stream)
21 {
22 print(name<ResultOf<Eval, R>>(), stream);
23 print(":\n", stream);
25 [&arg, &stream](auto const... indices)
26 {
27 print(typename R::Subscripts(indices...), stream);
28
29 print(": ", stream);
30 print(arg(indices...), stream);
31 print('\n', stream);
32 });
33 }
34}
35#endif // pRC_CORE_TENSOR_FUNCTIONS_PRINT_H
TN::Subscripts S
Definition externs_nonTT.hpp:9
Definition cholesky.hpp:10
std::invoke_result_t< F, Args... > ResultOf
Definition basics.hpp:59
static auto print(String< N > const &string, std::FILE *stream)
Definition print.hpp:18
static constexpr auto name()
Definition type_name.hpp:11
static constexpr auto arg(T const &a)
Definition arg.hpp:11
static constexpr auto range(F &&f, Xs &&...args)
Definition range.hpp:18