16 #include <type_traits>
23 namespace seqan3::detail
29 template <
typename index_type>
30 requires (std::integral<index_type> || simd_index<index_type>)
31 struct column_index_type : detail::strong_type<index_type, column_index_type<index_type>>
34 using detail::strong_type<index_type, column_index_type<index_type>>::strong_type;
42 template <std::
signed_
integral index_type>
43 column_index_type(index_type) -> column_index_type<std::ptrdiff_t>;
46 template <std::
unsigned_
integral index_type>
47 column_index_type(index_type) -> column_index_type<size_t>;
50 template <simd_index index_type>
51 column_index_type(index_type) -> column_index_type<index_type>;
58 template <
typename index_type>
59 requires (std::integral<index_type> || simd_index<index_type>)
60 struct row_index_type : detail::strong_type<index_type, row_index_type<index_type>>
63 using detail::strong_type<index_type, row_index_type<index_type>>::strong_type;
71 template <std::
signed_
integral index_type>
72 row_index_type(index_type) -> row_index_type<std::ptrdiff_t>;
75 template <std::
unsigned_
integral index_type>
76 row_index_type(index_type) -> row_index_type<size_t>;
79 template <simd_index index_type>
80 row_index_type(index_type) -> row_index_type<index_type>;
87 template <
typename index_t>
88 requires (std::integral<index_t> || simd_index<index_t>)
94 constexpr matrix_index() =
default;
95 constexpr matrix_index(matrix_index
const &) =
default;
96 constexpr matrix_index(matrix_index &&) =
default;
97 constexpr matrix_index & operator=(matrix_index
const &) =
default;
98 constexpr matrix_index & operator=(matrix_index &&) =
default;
99 ~matrix_index() =
default;
105 constexpr matrix_index(row_index_type<index_t>
const row_idx, column_index_type<index_t>
const col_idx) noexcept :
126 template <seqan3::arithmetic scalar_index_t>
127 constexpr matrix_index(row_index_type<scalar_index_t>
const row_idx,
128 column_index_type<scalar_index_t>
const col_idx) noexcept
132 row{simd::fill<index_t>(
static_cast<typename simd_traits<index_t>::scalar_type
>(row_idx.get()))},
133 col{simd::fill<index_t>(
static_cast<typename simd_traits<index_t>::scalar_type
>(col_idx.get()))}
139 template <std::
integral other_index_t>
140 requires (!std::same_as<other_index_t, index_t>)
141 explicit constexpr matrix_index(matrix_index<other_index_t> other) noexcept :
142 row{
static_cast<index_t
>(other.row)},
143 col{
static_cast<index_t
>(other.col)}
148 template <std::
integral first_index_t, std::
integral second_index_t>
151 return std::pair{
static_cast<first_index_t
>(col),
static_cast<second_index_t
>(row)};
166 template <std::
integral row_index_t, std::
integral col_index_t>
167 requires std::common_with<row_index_t, col_index_t>
168 matrix_index(row_index_type<row_index_t>, column_index_type<col_index_t>)
169 -> matrix_index<std::common_type_t<row_index_t, col_index_t>>;
172 template <simd_index index_t>
173 matrix_index(row_index_type<index_t>, column_index_type<index_t>) -> matrix_index<index_t>;
184 template <simd_index index_t>
185 using simd_matrix_coordinate = matrix_index<index_t>;
189 using matrix_offset = matrix_index<std::ptrdiff_t>;
Provides algorithms to modify seqan3::simd::simd_type.
The <concepts> header from C++20's standard library.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
matrix_index< size_t > matrix_coordinate
A coordinate type to access an element inside of a two-dimensional matrix.
Definition: matrix_coordinate.hpp:178
Provides basic data structure for strong types.
Provides concepts that do not have equivalents in C++20.
Provides seqan3::simd::simd_concept.