KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
debug_utils.h
Go to the documentation of this file.
1
29#ifndef KIDS_DEBUG_UTILS_H
30#define KIDS_DEBUG_UTILS_H
31
32#include <iomanip>
33#include <iostream>
34
35#include "kids/fmt.h"
36
37#define PRINT_ARRAY(_A, _n1, _n2) \
38 ({ \
39 std::cout << #_A << " = np.array([\n"; \
40 int _idxA = 0; \
41 for (int _i = 0; _i < (_n1); ++_i) { \
42 for (int _j = 0; _j < (_n2); ++_j) std::cout << FMT(4) << (_A)[_idxA++] << ","; \
43 std::cout << std::endl; \
44 } \
45 { std::cout << "])\n"; } \
46 })
47
48#define PRINT_ARRAY_8(_A, _n1, _n2) \
49 ({ \
50 std::cout << #_A << " = np.array([\n"; \
51 int _idxA = 0; \
52 for (int _i = 0; _i < (_n1); ++_i) { \
53 for (int _j = 0; _j < (_n2); ++_j) std::cout << FMT(8) << (_A)[_idxA++] << ","; \
54 std::cout << std::endl; \
55 } \
56 { std::cout << "])\n"; } \
57 })
58
59
60#endif // KIDS_DEBUG_UTILS_H
utils for formating