<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
testdefinitions.hpp
Go to the documentation of this file.
1
6//
7// Copyright (c) 2025, University of Colorado Denver. All rights reserved.
8//
9// This file is part of <T>LAPACK.
10// <T>LAPACK is free software: you can redistribute it and/or modify it under
11// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
12
13#ifndef TLAPACK_TESTDEFINITIONS_HH
14#define TLAPACK_TESTDEFINITIONS_HH
15
17
18#ifdef TLAPACK_TEST_EIGEN
22#endif
23
24#ifdef TLAPACK_TEST_MDSPAN
26#endif
27
28#ifdef TLAPACK_TEST_MPFR
30#endif
31
32#ifdef TLAPACK_TEST_QUAD
34#endif
35
36//
37// The matrix types that will be tested for routines
38// that only accept real matrices
39//
40#ifndef TLAPACK_REAL_TYPES_TO_TEST
41
42 #ifndef TLAPACK_LEGACY_REAL_TYPES_TO_TEST
43 #define TLAPACK_LEGACY_REAL_TYPES_TO_TEST \
44 (tlapack::LegacyMatrix<float, std::size_t, \
45 tlapack::Layout::ColMajor>), \
46 (tlapack::LegacyMatrix<double, std::size_t, \
47 tlapack::Layout::ColMajor>), \
48 (tlapack::LegacyMatrix<float, std::size_t, \
49 tlapack::Layout::RowMajor>), \
50 (tlapack::LegacyMatrix<double, std::size_t, \
51 tlapack::Layout::RowMajor>)
52template class tlapack::
54template class tlapack::
56template class tlapack::
58template class tlapack::
60 #endif
61
62 #ifdef TLAPACK_TEST_MPFR
63 #define TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_MPREAL \
64 , tlapack::LegacyMatrix<mpfr::mpreal>
66 #else
67 #define TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_MPREAL
68 #endif
69
70 #ifdef TLAPACK_TEST_QUAD
71 #define TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_QUAD \
72 , tlapack::LegacyMatrix<__float128>
74 #else
75 #define TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_QUAD
76 #endif
77
78 #ifdef TLAPACK_TEST_EIGEN
79 #define TLAPACK_EIGEN_REAL_TYPES_TO_TEST \
80 , Eigen::MatrixXf, Eigen::MatrixXd, \
81 (Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, \
82 Eigen::RowMajor>), \
83 (Eigen::Matrix<Eigen::half, Eigen::Dynamic, Eigen::Dynamic>)
84 #else
85 #define TLAPACK_EIGEN_REAL_TYPES_TO_TEST
86 #endif
87
88 #ifdef TLAPACK_TEST_MDSPAN
89 #define TLAPACK_MDSPAN_REAL_TYPES_TO_TEST \
90 , \
91 (std::experimental::mdspan< \
92 float, std::experimental::dextents<std::size_t, 2>, \
93 std::experimental::layout_left>), \
94 (std::experimental::mdspan< \
95 float, std::experimental::dextents<std::size_t, 2>, \
96 std::experimental::layout_right>)
97template class std::experimental::mdspan<
98 float,
99 std::experimental::dextents<std::size_t, 2>,
100 std::experimental::layout_left>;
101template class std::experimental::mdspan<
102 float,
103 std::experimental::dextents<std::size_t, 2>,
104 std::experimental::layout_right>;
105 #else
106 #define TLAPACK_MDSPAN_REAL_TYPES_TO_TEST
107 #endif
108
109 #define TLAPACK_REAL_TYPES_TO_TEST \
110 TLAPACK_LEGACY_REAL_TYPES_TO_TEST \
111 TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_MPREAL \
112 TLAPACK_EIGEN_REAL_TYPES_TO_TEST \
113 TLAPACK_MDSPAN_REAL_TYPES_TO_TEST \
114 TLAPACK_LEGACY_REAL_TYPES_TO_TEST_WITH_QUAD
115#endif
116
117//
118// The matrix types that will be tested for routines
119// that only accept complex matrices
120//
121#ifndef TLAPACK_COMPLEX_TYPES_TO_TEST
122
123 #ifndef TLAPACK_LEGACY_COMPLEX_TYPES_TO_TEST
124 #define TLAPACK_LEGACY_COMPLEX_TYPES_TO_TEST \
125 (tlapack::LegacyMatrix<std::complex<float>, std::size_t, \
126 tlapack::Layout::ColMajor>), \
127 (tlapack::LegacyMatrix<std::complex<double>, std::size_t, \
128 tlapack::Layout::ColMajor>), \
129 (tlapack::LegacyMatrix<std::complex<float>, std::size_t, \
130 tlapack::Layout::RowMajor>), \
131 (tlapack::LegacyMatrix<std::complex<double>, std::size_t, \
132 tlapack::Layout::RowMajor>)
133template class tlapack::
134 LegacyMatrix<std::complex<float>, std::size_t, tlapack::Layout::ColMajor>;
135template class tlapack::
136 LegacyMatrix<std::complex<double>, std::size_t, tlapack::Layout::ColMajor>;
137template class tlapack::
138 LegacyMatrix<std::complex<float>, std::size_t, tlapack::Layout::RowMajor>;
139template class tlapack::
140 LegacyMatrix<std::complex<double>, std::size_t, tlapack::Layout::RowMajor>;
141 #endif
142
143 #ifdef TLAPACK_TEST_EIGEN
144 #define TLAPACK_EIGEN_COMPLEX_TYPES_TO_TEST \
145 , Eigen::MatrixXcf, Eigen::MatrixXcd, \
146 (Eigen::Matrix<std::complex<float>, Eigen::Dynamic, \
147 Eigen::Dynamic, Eigen::RowMajor>)
148 #else
149 #define TLAPACK_EIGEN_COMPLEX_TYPES_TO_TEST
150 #endif
151
152 #define TLAPACK_COMPLEX_TYPES_TO_TEST \
153 TLAPACK_LEGACY_COMPLEX_TYPES_TO_TEST \
154 TLAPACK_EIGEN_COMPLEX_TYPES_TO_TEST
155
156#endif
157
158//
159// List of matrix types that will be tested
160//
161#ifndef TLAPACK_TYPES_TO_TEST
162 #define TLAPACK_TYPES_TO_TEST \
163 TLAPACK_REAL_TYPES_TO_TEST, TLAPACK_COMPLEX_TYPES_TO_TEST
164#endif
165
166#endif // TLAPACK_TESTDEFINITIONS_HH
Eigen::bfloat16 compatibility with tlapack::concepts::Real.
Eigen::half compatibility with tlapack::concepts::Real.
Compatibility layer for the GNU type __float128.
mpfr::mpreal compatibility with tlapack::concepts::Real
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