11#ifndef TLAPACK_TEST_TESTUPLOMATRIX_HH
12#define TLAPACK_TEST_TESTUPLOMATRIX_HH
33 class idx_t = std::size_t,
34 Uplo uplo = Uplo::Upper,
35 Layout L = Layout::ColMajor>
45 constexpr const T& operator()(idx_t i, idx_t j)
const noexcept
47 if (
uplo == Uplo::Upper)
49 else if (
uplo == Uplo::Lower)
56 constexpr T& operator()(idx_t i, idx_t j)
noexcept
58 if (uplo == Uplo::Upper)
60 else if (uplo == Uplo::Lower)
71 template <
typename T,
class idx_t, Uplo uplo, Layout L>
75 template <
typename T,
class idx_t, Uplo uplo, Layout L>
79 template <
typename T,
class idx_t, Uplo uplo, Layout L>
83 template <
class T,
class idx_t, Uplo uplo, Layout L>
90#define isSlice(SliceSpec) !std::is_convertible<SliceSpec, idx_t>::value
107 B.modifier =
A.modifier + cols.first - rows.first;
113template <
typename T,
class idx_t, Uplo uplo, Layout layout,
class SliceSpec>
114constexpr auto rows(
const TestUploMatrix<T, idx_t, uplo, layout>& A,
115 SliceSpec&& slice)
noexcept
117 TestUploMatrix<const T, idx_t, uplo, layout> B(
119 B.modifier = A.modifier - slice.first;
123template <
typename T,
class idx_t, Uplo uplo, Layout layout,
class SliceSpec>
124constexpr auto cols(
const TestUploMatrix<T, idx_t, uplo, layout>& A,
125 SliceSpec&& slice)
noexcept
127 TestUploMatrix<const T, idx_t, uplo, layout> B(
129 B.modifier = A.modifier + slice.first;
133#define isSlice(SliceSpec) !std::is_convertible<SliceSpec, idx_t>::value
142 typename std::enable_if<isSlice(SliceSpecRow) && isSlice(SliceSpecCol),
144constexpr auto slice(TestUploMatrix<T, idx_t, uplo, layout>& A,
146 SliceSpecCol&& cols)
noexcept
148 TestUploMatrix<T, idx_t, uplo, layout> B(
150 B.modifier = A.modifier + cols.first - rows.first;
156template <
typename T,
class idx_t, Uplo uplo, Layout layout,
class SliceSpec>
157constexpr auto rows(TestUploMatrix<T, idx_t, uplo, layout>& A,
158 SliceSpec&& slice)
noexcept
160 TestUploMatrix<T, idx_t, uplo, layout> B(
162 B.modifier = A.modifier - slice.first;
166template <
typename T,
class idx_t, Uplo uplo, Layout layout,
class SliceSpec>
167constexpr auto cols(TestUploMatrix<T, idx_t, uplo, layout>& A,
168 SliceSpec&& slice)
noexcept
170 TestUploMatrix<T, idx_t, uplo, layout> B(
172 B.modifier = A.modifier + slice.first;
constexpr Layout layout
Layout of a matrix or vector.
Definition arrayTraits.hpp:232
Uplo
Definition types.hpp:50
Layout
Definition types.hpp:29
Concept for matrices that can be converted to a legacy matrix.
Concept for types that represent tlapack::Uplo.
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
Legacy matrix.
Definition LegacyMatrix.hpp:34
TestUploMatrix class.
Definition TestUploMatrix.hpp:36
int modifier
Modifier to the access region. Enables slicing of the matrix.
Definition TestUploMatrix.hpp:37
Functor for data creation.
Definition arrayTraits.hpp:89
Complex type traits for the list of types Types.
Definition scalar_type_traits.hpp:145
Trait to determine the layout of a given data structure.
Definition arrayTraits.hpp:75
Real type traits for the list of types Types.
Definition scalar_type_traits.hpp:71