10#ifndef TLAPACK_DEBUG_UTILS_HH
11#define TLAPACK_DEBUG_UTILS_HH
28template <TLAPACK_MATRIX matrix_t>
32 const idx_t m = std::min<idx_t>(100, nrows(
A));
33 const idx_t n = std::min<idx_t>(100, ncols(
A));
35 for (idx_t i = 0; i < m; ++i) {
36 std::cout << std::endl;
37 for (idx_t j = 0; j < n; ++j)
38 std::cout << std::setw(16) <<
A(i, j) <<
" ";
50template <TLAPACK_MATRIX matrix_t>
54 const idx_t m = std::min<idx_t>(100, nrows(
A));
55 const idx_t n = std::min<idx_t>(100, ncols(
A));
60 stream <<
"{ \"kind\":{ \"text\": true },\"text\": \"";
63 for (idx_t j = 0; j < n; ++j)
68 for (idx_t i = 0; i < m; ++i) {
69 for (idx_t j = 0; j < n; ++j)
70 stream << std::setw(
width) << std::setprecision(3) <<
A(i, j)
88template <TLAPACK_MATRIX matrix_t>
92 const idx_t m = std::min<idx_t>(100, nrows(
A));
93 const idx_t n = std::min<idx_t>(100, ncols(
A));
96 stream <<
"{ \"kind\":{ \"plotly\": true },\"data\":[{";
99 stream <<
"\"header\":{\"values\":[";
100 for (idx_t j = 0; j < n; ++j) {
102 if (j + 1 < n)
stream <<
", ";
107 stream <<
"\"cells\":{\"values\":[";
108 for (idx_t j = 0; j < n; ++j) {
110 for (idx_t i = 0; i < m; ++i) {
111 stream <<
"\"" << std::setprecision(3) <<
A(i, j) <<
"\"";
112 if (i + 1 < m)
stream <<
", ";
115 if (j + 1 < n)
stream <<
", ";
119 stream <<
"\"type\": \"table\"}],\"layout\": {}}";
132template <TLAPACK_MATRIX matrix_t>
136 const idx_t n = std::max(ncols(
A), nrows(
A));
std::string visualize_matrix_text(const matrix_t &A)
Constructs a json string representing the matrix for use with vscode-debug-visualizer.
Definition debugutils.hpp:51
std::string visualize_matrix_table(const matrix_t &A)
Constructs a json string representing the matrix for use with vscode-debug-visualizer.
Definition debugutils.hpp:89
void print_matrix(const matrix_t &A)
Prints a matrix a to std::out.
Definition debugutils.hpp:29
std::string visualize_matrix(const matrix_t &A)
Constructs a json string representing the matrix for use with vscode-debug-visualizer.
Definition debugutils.hpp:133
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113