forked from tlapack/tlapack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestutils.cpp
103 lines (98 loc) · 2.56 KB
/
testutils.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include "testutils.hpp"
namespace tlapack {
namespace catch2 {
std::string return_scanf(const char*)
{
std::string str;
std::cin >> str;
return str;
}
std::string return_scanf(std::string) { return return_scanf(""); }
} // namespace catch2
//
// GDB doesn't handle templates well, so we explicitly define some versions of
// the functions for common template arguments
//
void print_matrix_r(const LegacyMatrix<float, size_t, Layout::ColMajor>& A)
{
print_matrix(A);
}
void print_matrix_d(const LegacyMatrix<double, size_t, Layout::ColMajor>& A)
{
print_matrix(A);
}
void print_matrix_c(
const LegacyMatrix<std::complex<float>, size_t, Layout::ColMajor>& A)
{
print_matrix(A);
}
void print_matrix_z(
const LegacyMatrix<std::complex<double>, size_t, Layout::ColMajor>& A)
{
print_matrix(A);
}
void print_rowmajormatrix_r(
const LegacyMatrix<float, size_t, Layout::RowMajor>& A)
{
print_matrix(A);
}
void print_rowmajormatrix_d(
const LegacyMatrix<double, size_t, Layout::RowMajor>& A)
{
print_matrix(A);
}
void print_rowmajormatrix_c(
const LegacyMatrix<std::complex<float>, size_t, Layout::RowMajor>& A)
{
print_matrix(A);
}
void print_rowmajormatrix_z(
const LegacyMatrix<std::complex<double>, size_t, Layout::RowMajor>& A)
{
print_matrix(A);
}
//
// GDB doesn't handle templates well, so we explicitly define some versions of
// the functions for common template arguments
//
std::string visualize_matrix_r(
const LegacyMatrix<float, size_t, Layout::ColMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_matrix_d(
const LegacyMatrix<double, size_t, Layout::ColMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_matrix_c(
const LegacyMatrix<std::complex<float>, size_t, Layout::ColMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_matrix_z(
const LegacyMatrix<std::complex<double>, size_t, Layout::ColMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_rowmajormatrix_r(
const LegacyMatrix<float, size_t, Layout::RowMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_rowmajormatrix_d(
const LegacyMatrix<double, size_t, Layout::RowMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_rowmajormatrix_c(
const LegacyMatrix<std::complex<float>, size_t, Layout::RowMajor>& A)
{
return visualize_matrix(A);
}
std::string visualize_rowmajormatrix_z(
const LegacyMatrix<std::complex<double>, size_t, Layout::RowMajor>& A)
{
return visualize_matrix(A);
}
} // namespace tlapack